home *** CD-ROM | disk | FTP | other *** search
/ T&A 2 the Maxx 3 / T and A 2 The Maxx Number 3.iso / viewers / unixview / xgl17dta.z / xgl17dta / docs next >
Text File  |  1991-07-24  |  140KB  |  4,123 lines

  1.  
  2. search for ++-- to get to the start of each doc...
  3.  
  4. ++---------------------------------------------------------------------
  5.  
  6.                                      G R A S P
  7.  
  8.                          GRAphical System for Presentation
  9.  
  10.                            Another USEware product from:
  11.  
  12.                              Microtex Industries, Inc.
  13.                             2091 Business Center Drive
  14.                                 Irvine, Ca.  92715
  15.                                   (714) 476-0777
  16.  
  17.                     (714) 545-8100 - PCPaint Picture Swap Line
  18.  
  19.         Current release number: 1.10*           Current release date :05/86
  20.  
  21.  
  22.                              GRASP - Table of Contents
  23.                              =========================
  24.  
  25.          Overview of Product . . . . . . . . . . . . . . . . . . . . .    1
  26.  
  27.               What is GRASP? . . . . . . . . . . . . . . . . . . . . .    3
  28.               What is on the GRASP disk? . . . . . . . . . . . . . . .    4
  29.               Making a working copy of the GRASP disk  . . . . . . . .    6
  30.               Installing GRASP . . . . . . . . . . . . . . . . . . . .    7
  31.               GRASP Installation Diagram . . . . . . . . . . . . . . .    8
  32.               How do I use GRASP?  . . . . . . . . . . . . . . . . . .    9
  33.               Running GRASP  . . . . . . . . . . . . . . . . . . . . .   10
  34.               The Grasp Editor . . . . . . . . . . . . . . . . . . . .   12
  35.               Simple GRASP Tutorial  . . . . . . . . . . . . . . . . .   15
  36.               Running the library file version - GRASPRT . . . . . . .   18
  37.               Using the GRASP Graphics Librarian - GLIB  . . . . . . .   19
  38.  
  39.          The commands of GRASP - Detailed  . . . . . . . . . . . . . .   21
  40.  
  41.               BOX  . . . . . . . . . . . . . . . . . . . . . . . . . .   23
  42.               CFADE  . . . . . . . . . . . . . . . . . . . . . . . . .   24
  43.               CFREE  . . . . . . . . . . . . . . . . . . . . . . . . .   25
  44.               CHGCOLOR . . . . . . . . . . . . . . . . . . . . . . . .   26
  45.               CIRCLE . . . . . . . . . . . . . . . . . . . . . . . . .   27
  46.               CLEARSCR . . . . . . . . . . . . . . . . . . . . . . . .   28
  47.               CLOAD  . . . . . . . . . . . . . . . . . . . . . . . . .   29
  48.               COLOR  . . . . . . . . . . . . . . . . . . . . . . . . .   30
  49.               EXEC . . . . . . . . . . . . . . . . . . . . . . . . . .   31
  50.               EXIT . . . . . . . . . . . . . . . . . . . . . . . . . .   32
  51.               FFREE  . . . . . . . . . . . . . . . . . . . . . . . . .   33
  52.               FGAPS  . . . . . . . . . . . . . . . . . . . . . . . . .   34
  53.               FLOAD  . . . . . . . . . . . . . . . . . . . . . . . . .   35
  54.               FLOAT  . . . . . . . . . . . . . . . . . . . . . . . . .   36
  55.               FLY  . . . . . . . . . . . . . . . . . . . . . . . . . .   37
  56.               FSTYLE . . . . . . . . . . . . . . . . . . . . . . . . .   38
  57.               GOSUB  . . . . . . . . . . . . . . . . . . . . . . . . .   39
  58.               GOTO . . . . . . . . . . . . . . . . . . . . . . . . . .   40
  59.               IFKEY  . . . . . . . . . . . . . . . . . . . . . . . . .   41
  60.               LINE   . . . . . . . . . . . . . . . . . . . . . . . . .   42
  61.               LINK . . . . . . . . . . . . . . . . . . . . . . . . . .   43
  62.               LOOP . . . . . . . . . . . . . . . . . . . . . . . . . .   44
  63.               MARK . . . . . . . . . . . . . . . . . . . . . . . . . .   45
  64.               MODE . . . . . . . . . . . . . . . . . . . . . . . . . .   46
  65.               NOISE  . . . . . . . . . . . . . . . . . . . . . . . . .   48
  66.               OFFSET . . . . . . . . . . . . . . . . . . . . . . . . .   49
  67.               PALETTE  . . . . . . . . . . . . . . . . . . . . . . . .   50
  68.               PAN  . . . . . . . . . . . . . . . . . . . . . . . . . .   51
  69.               PFADE  . . . . . . . . . . . . . . . . . . . . . . . . .   52
  70.               PFREE  . . . . . . . . . . . . . . . . . . . . . . . . .   53
  71.               PLOAD  . . . . . . . . . . . . . . . . . . . . . . . . .   54
  72.               POINT  . . . . . . . . . . . . . . . . . . . . . . . . .   55
  73.               PUTUP  . . . . . . . . . . . . . . . . . . . . . . . . .   56
  74.               RESETSCR . . . . . . . . . . . . . . . . . . . . . . . .   57
  75.               RETURN . . . . . . . . . . . . . . . . . . . . . . . . .   58
  76.               SETCOLOR . . . . . . . . . . . . . . . . . . . . . . . .   59
  77.               TEXT . . . . . . . . . . . . . . . . . . . . . . . . . .   60
  78.               TRAN . . . . . . . . . . . . . . . . . . . . . . . . . .   61
  79.               VIDEO  . . . . . . . . . . . . . . . . . . . . . . . . .   62
  80.               WAITKEY  . . . . . . . . . . . . . . . . . . . . . . . .   64
  81.               WINDOW . . . . . . . . . . . . . . . . . . . . . . . . .   65
  82.  
  83.          Tips, Hints, Examples and Demo Programs . . . . . . . . . . .   67
  84.  
  85.               Example Program #1 - Slide Show  . . . . . . . . . . . .   69
  86.               Example Program #2 - How to animate using FLY  . . . . .   70
  87.  
  88.          APPENDIX A - Command Summary  . . . . . . . . . . . . . . . .   71
  89.  
  90.          APPENDIX B - Fade Table . . . . . . . . . . . . . . . . . . .   73
  91.  
  92.          APPENDIX C - Error Messages . . . . . . . . . . . . . . . . .   75
  93.  
  94.          APPENDIX D - Picture Swap Line  . . . . . . . . . . . . . . .   79
  95.  
  96.          APPENDIX E - GRASP Order Form . . . . . . . . . . . . . . . .   81
  97.  
  98.  
  99.                                 Overview of Product
  100.  
  101.                                   What is GRASP?
  102.  
  103.         GRASP is a simple graphics programming pseudo-language which can be
  104.         used to create and run animated graphics demonstrations, tutorials,
  105.         and  presentations  on  an  IBM  PC/XT/AT or respective compatible.
  106.         GRASP requires that the user make use of  some other  tool, such as
  107.         Mouse Systems'  PCPAINT PLUS, to create PCPAINT PLUS packed page or
  108.         BSAVE format pictures, or 'capture' screens from any other graphics
  109.         software with  the provided  capture utility  program. This product
  110.         was developed by the folks at  Microtex Industries,  the authors of
  111.         PCPAINT PLUS, so it is patterned to take advantage of the pictures,
  112.         clippings and fonts  created  with  PCPAINT  PLUS  and  its related
  113.         utilities, like FONTASIA and ARTOOLS.
  114.  
  115.  
  116.         Features:
  117.  
  118.         * Supports IBM CGA, IBM EGA, HERCULES, AST ColorGraphPlus,
  119.           Plantronics, AST Preview, 3 text modes.
  120.  
  121.         * 16 Picture Buffers
  122.  
  123.         * 128 Clipping Buffers
  124.  
  125.         * Single command to control animation sequences
  126.  
  127.         * 25 different fades with limitless combinations
  128.  
  129.         * Simple ASCII file format
  130.  
  131.         * FONTRIX(tm) font compatible
  132.  
  133.         * Fully PCPAINT PLUS from MOUSE SYSTEMS(tm) compatible
  134.  
  135.         * Run Custom Programs from within GRASP program
  136.  
  137.  
  138.                            What is on the GRASP disk?
  139.  
  140.  
  141.         The following files are on the GRASP disk
  142.  
  143.         GRASP.EXE -
  144.  
  145.         This is  the main  GRASP program.   This  version of GRASP gets the
  146.         pictures, character sets, clippings  and text  files it  needs from
  147.         the current  directory on your current disk drive, unless otherwise
  148.         specified in  the text  files. This  program allows  you to create,
  149.         edit and execute your GRASP programs.
  150.  
  151.         GRASPRT.EXE - 
  152.  
  153.         This is  the run-time  version of GRASP. This version of GRASP gets
  154.         the pictures, character sets,  clippings, and text it needs  from a
  155.         graphics library  created with  the GRASP  graphics librarian GLIB.
  156.         This version only allows you to execute completed programs that are
  157.         in library  form. No  editing of  the files  is possible. This .EXE
  158.         file, along with your .GL file, may be  distributed without license
  159.         fees or other compensation.
  160.  
  161.         GLIB.COM - 
  162.  
  163.         Library    manager  for  version  GRASPRT  of GRASP product. Allows
  164.         management of all necessary files in  a library  environment rather
  165.         than as files in a subdirectory on a disk. 
  166.  
  167.         WHATPIC.EXE - 
  168.  
  169.         Utility program to determine size and color combinations of PCPAINT
  170.         PLUS pictures.
  171.  
  172.         WHATCLP.EXE - 
  173.  
  174.         Utility program to determine size and color combinations of PCPAINT
  175.         PLUS clippings.
  176.  
  177.         CAP.COM -
  178.  
  179.         Capture Program  for capturing  screens and clippings from all your
  180.         favorite software.
  181.  
  182.         STENCIL.SET -
  183.         OLDTIME.SET -
  184.         ROMAN.SET   -
  185.         PIGFONT.SET -
  186.         DOTTIE.SET  -
  187.  
  188.         Some fonts for you to use in your demo.  
  189.  
  190.         ED1.HLP     -
  191.         CM1.HLP     -
  192.         CM2.HLP     -
  193.         CM3.HLP     -
  194.         FD1.HLP     -
  195.         FD2.HLP     -
  196.         RP1.HLP     -
  197.  
  198.         Various help files.
  199.  
  200.                       Making a working copy of the GRASP disk
  201.  
  202.  
  203.         The GRASP disk is not copy protected in any way. You should back up
  204.         the disk  using the DOS diskcopy command, or you may perform a file
  205.         by file backup to a hard disk using the DOS copy command. There are
  206.         several different  ways to  copy disks under DOS, but the following
  207.         will  work  on  almost  any  hardware  configuration  since  all it
  208.         requires is access to the DOS master disk and 1 floppy disk drive.
  209.  
  210.         For PCs with 1 or 2 floppys, or an XT or AT with 1 floppy:
  211.  
  212.         Put your  DOS master  disk in  drive A  and turn  on the machine or
  213.         press CTRL-ALT-DEL to re-boot the system.  Enter the  Date and Time
  214.         when prompted and you should see the system prompt:
  215.  
  216.         A>_
  217.  
  218.         Type:
  219.  
  220.         A>DISKCOPY A: A:
  221.  
  222.         and press  the return  key. You  will be prompted to put the SOURCE
  223.         disk in drive A. Remove the DOS master disk from  drive A,  put the
  224.         GRASP distribution  disk in,  close the  door and  press the return
  225.         key. After it reads some information, DOS will  ask you  to put the
  226.         TARGET disk in drive A. Put a blank disk (formatted or unformatted)
  227.         into drive A, close the door and press return. If  your machine has
  228.         less than  512K of memory, you may be prompted to perform this disk
  229.         exchange several times. When the process is complete, put the GRASP
  230.         disk away in a safe place and use the backup copy for your work.
  231.  
  232.  
  233.                                  Installing GRASP
  234.  
  235.  
  236.         Simple Set-Up
  237.         -------------
  238.  
  239.         To  develop  demos  under  the  grasp  system, you need to have the
  240.         following GRASP files and programs accessible:
  241.  
  242.         GRASP.EXE
  243.         CM1.HLP
  244.         CM2.HLP
  245.         ED1.HLP
  246.         FD1.HLP
  247.         FD2.HLP
  248.         RP1.HLP
  249.  
  250.         as well as your pictures, clippings and fonts.
  251.  
  252.         With all of these files in  one subdirectory,  you will  be able to
  253.         create and  edit your  demo program and have access to the help. If
  254.         you do not need the help files, you may omit them. If you are going
  255.         to be  creating a  library version of your demo, you will also need
  256.         access to the librarian utility, GLIB.EXE. 
  257.  
  258.  
  259.  
  260.         Advanced Set-Up
  261.         ---------------
  262.  
  263.         The following is an example of a well set-up system on a hard disk,
  264.         including PCPAINT,  so that you can edit pictures and clippings and
  265.         create your demo with a minimum of effort.
  266.  
  267.         From the root directory, create a sub-directory called PAINTLIB and
  268.         put all  the PCPAINT  files in  it. (This is the recommended method
  269.         for installing PCPAINT). In addition, be  sure your  PATH statement
  270.         points to  PAINTLIB and  set up an environment variable to point to
  271.         PAINTLIB as well with the command:
  272.  
  273.         SET PAINTLIB=C:\PAINTLIB
  274.  
  275.         Also make a sub-directory off the root called GRASP. Copy the GRASP
  276.         disk contents  to the  sub-directory GRASP. Add the GRASP directory
  277.         to your PATH command. Then create a DEMO  directory, change  to it,
  278.         and run  GRASP by  typing GRASP at the command prompt. When you are
  279.         in the GRASP editor, you can  run PCPAINT  by pressing  ALT-F10 and
  280.         your previous  PATH and  SET statements will help DOS know where to
  281.         find it. The following diagram is an example:
  282.  
  283.                             GRASP Installation Diagram
  284.  
  285.  
  286.         This diagram  shows the  proper structure  for your sub-directories
  287.         for GRASP  to perform  in the  above stated  manner. This  is not a
  288.         requirement, just an example.
  289.                                        
  290.                                    ___________
  291.                                   |           |
  292.                                   |  C:\Root  |
  293.                                   |___________|
  294.                 ________________________|________________________ . . . .
  295.          ______|_______    ______|______    __________|__________    
  296.         |              |  |             |  |                     |
  297.         |   PAINTLIB   |  |    GRASP    |  |    DOS or OTHER     |
  298.         |______________|  |_____________|  |_____________________|   
  299.             :                  :      |          : 
  300.         PCPAINT.EXE        GRASP.EXE  |      DOS files
  301.         PxPAINT.OVR        ED1.HLP    |      Various batch files 
  302.         CAP.COM            CM1.HLP    |
  303.                            CM2.HLP    | 
  304.                            CM3.HLP    |
  305.                            FD1.HLP    |
  306.                            FD2.HLP    |
  307.                            RP1.HLP    |
  308.                                       |
  309.                            ___________|_ 
  310.                           |             | 
  311.                           |    Demos    |
  312.                           |_____________|
  313.  
  314.         Then these statements would be in your AUTOEXEC.BAT file:
  315.  
  316.         SET PAINTLIB=C:\PAINTLIB
  317.         PATH C:\PAINTLIB;C:\GRASP;C:\whateverelseyouwant...
  318.  
  319.         With this  set-up, you  can be  in any  directory and  run GRASP by
  320.         typing GRASP and PCPAINT by typing PCPAINT. You have full access to
  321.         all help files and the  PCPAINT  system.  The  auto-run  feature in
  322.         GRASP (ALT-F10)  allows you to run PCPAINT while in GRASP. It looks
  323.         for PCPAINT in the \PAINTLIB directory.  The  GRASP help  files are
  324.         only accessible if they are in one of three places:
  325.  
  326.         1) In the current directory
  327.         2) In the directory pointed to by the environment string 'PAINTLIB'
  328.         3) In a sub-directory off the root called 'GRASP'
  329.  
  330.         GRASP performs  a search  for the help files in this order. If they
  331.         are not found, a message  will  appear  when  you  first  run grasp
  332.         telling you so. You may run GRASP without access to the help files,
  333.         but you will get a beep if you try to access them.
  334.  
  335.                                 How do I use GRASP?
  336.  
  337.  
  338.         To use GRASP you need to do 3 things.
  339.  
  340.  
  341.         1) Create the pictures and clippings you want  to use  with PCPAINT
  342.         PLUS, or capture them the the CAP utility.
  343.  
  344.         2) Use the built-in GRASP editor to create an GRASP 'program' which
  345.         is nothing more than a list of GRASP commands and some comments.
  346.  
  347.         3) Run your demonstration  by pressing  F10 from  the editor  or by
  348.         selecting EXECUTE FILE from the main GRASP menu.
  349.  
  350.  
  351.         It's that  simple. If you want to give your demo away, you must put
  352.         the .PIC, .CLP, .SET and .TXT  files into  a library  with the GLIB
  353.         utility, and distribute the library file with GRASPRT.EXE.
  354.  
  355.  
  356.                                    Running GRASP
  357.  
  358.         To run the GRASP, enter at the command prompt:
  359.  
  360.         A:>GRASP
  361.  
  362.         You will be presented with a screen that looks something like this:
  363.  
  364.                                      G R A S P
  365.                          GRAphical System for Presentation
  366.                              Version 1.10* - May, 1986
  367.                   Copyright (C) 1986 - Microtex Industries, Inc.
  368.  
  369.                                     Edit File      
  370.                                     Execute File   
  371.                                     Load File      
  372.                                     Save File      
  373.                                     Quit GRASP     
  374.  
  375.                                Current File: TMPFILE
  376.  
  377.         To select  an option from this menu, use the up and down arrow keys
  378.         until the option you want to select is highlighted. Then just press
  379.         return  and  the  option  is  selected. Each of these options has a
  380.         special meaning to GRASP.
  381.  
  382.         Edit File: The Edit File option tells GRASP that you want to  go to
  383.         the editor and create or modify your GRASP program file.
  384.  
  385.         Execute File:  The Execute  File option  tells GRASP to execute the
  386.         currently loaded GRASP program file.
  387.  
  388.         Load File: The Load File option allows you to tell GRASP to load in
  389.         an existing  file, or  to create  a new one. Notice that just below
  390.         the menu there is an area  with the  current filename  listed. When
  391.         you  first  run  GRASP,  the  system  will  default to a file named
  392.         TMPFILE. This is the name that GRASP will use unless  you specify a
  393.         new one.  To specify  a new one, just type in the name you want. DO
  394.         NOT specify  the filename  extension. GRASP  will automatically use
  395.         the extension  .TXT for you. To create a new file, just perform the
  396.         load as though the  file you  want already  exists. GRASP  is smart
  397.         enough to  understand and  create a  new file for you. If a file is
  398.         already loaded, and changes have been  made, GRASP  will prompt you
  399.         for saving before allowing you to load another. This keeps you from
  400.         trashing your current file.
  401.  
  402.         Save File: The Save File option tells GRASP that you want to save
  403.         the current working GRASP program file. It works  much the  same as
  404.         the load  command. Just  specify the name you want to save the file
  405.         under and press return. The  system  will  default  to  the current
  406.         working name.
  407.  
  408.         Quit GRASP: The Quit GRASP option tells the system that you want to
  409.         exit GRASP. If a file is loaded and has been changed since the last
  410.         save, GRASP will prompt you for saving before allowing you to quit.
  411.  
  412.         Be sure to save your file before quitting!
  413.  
  414.  
  415.         Of these  options, the only one that requires special consideration
  416.         is the first one, Edit File. Select that  option and  let's explore
  417.         the world of the GRASP editor...
  418.                                  The Grasp Editor
  419.  
  420.  
  421.         If you  have selected  the Edit File option from the main menu, you
  422.         will now be in the GRASP editor. The screen should have a blue line
  423.         across the top that looks like the following:
  424.  
  425.  
  426.         TMPFILE         COL:1     LINE:1     POS:0     LEN:0      INSERT ON
  427.  
  428.         These are  just information  items about  the current  file you are
  429.         working on and the mode you are operating in. Starting  at the left
  430.         is the  name of  the current  file, which defaults to TMPFILE. Next
  431.         comes the current cursor column  number,  the  current  cursor line
  432.         number,  the  current  cursor's  character position relative to the
  433.         entire file, and the total  number  of  characters  in  the current
  434.         file.  At  the  far  right  is  the  status  of the INS key on your
  435.         keyboard. If INSERT mode is ON,  then characters  you type  will be
  436.         inserted before  the character  just to the right of the cursor. If
  437.         INSERT mode is OFF, then characters to the right of the cursor will
  438.         be overwritten.  This second  mode, INSERT  OFF, is commonly called
  439.         OVERSTRIKE mode. This information is just there for  reference, and
  440.         with the  exception of  the INSERT  mode signal, you probably won't
  441.         need to refer to it too often.
  442.  
  443.         The first three function keys are the most important keys  to learn
  444.         in  the  GRASP  editor.  GRASP  provides  'Quick  Help'  for  three
  445.         different areas and is accessable by pressing F1, F2 or F3. 
  446.  
  447.         NOTE: If you press one of these function keys and  hear a  low tone
  448.         from  your  computer  and  no  help  appears,  it  means that GRASP
  449.         couldn't find the .HLP files that  were on  your distribution disk.
  450.         If you  want to use the help. the .HLP files must be on the current
  451.         drive and directory, in a directory called 'GRASP' directly off the
  452.         root directory,  or in  a directory  pointed to  by the environment
  453.         string 'PAINTLIB'. See INSTALLING GRASP for more details.
  454.  
  455.         F1 - Provides help in using the GRASP Editor. This  includes a list
  456.         of the  most commonly  used editing  keys and a description of what
  457.         each function key is used for.
  458.  
  459.         F2 - Provides  a  quick  summary  listing  of  all  available GRASP
  460.         commands.  This  information  is  not  a  complete reference on the
  461.         commands of GRASP, but  rather a  command syntax  reference so that
  462.         you  can   insure  proper  useage  of  the  commands  and  a  brief
  463.         description of what the command is used for. 
  464.  
  465.         F3 - Provides a  summary listing  of the  25 GRASP  fades and their
  466.         respective  numbers.  Remember  that  all  fades  can  be  used for
  467.         graphics  pictures,  text  pictures,  pictures  in   a  window  and
  468.         clippings.
  469.  
  470.         If this  is your  first time  running GRASP and you are too lazy or
  471.         too bored  to  read  the  entire  manual,  you  should  find enough
  472.         information in these help keys to get you started.
  473.  
  474.         If you want to learn a little more about the editor, here is a full
  475.         description of all the keys available in the GRASP editor.
  476.  
  477.         F1  - Quick help with the editor.
  478.         F2  - Quick help with the commands.
  479.         F3  - Quick help with the fades and video modes.
  480.         F4  - Start/End highlighting a block.
  481.         F5  - Copy a highlighted block.
  482.         F6  - Move a highlighted block.
  483.         F7  - Read a block in from disk.
  484.         F8  - Write a highlighted block to disk.
  485.         F9  - Save current file and run from current line.
  486.         F10 - Save current file and run from the top.
  487.  
  488.         ALT/F1   - Quick exit to DOS. Typing EXIT at the DOS propmt returns
  489.                    you to the GRASP editor.
  490.  
  491.         ALT/F10  - Run  PCPAINT  from  within the GRASP editor. PCPAINT.EXE
  492.                    and  its  overlays  must  be  in  a  subdirectory called
  493.                    PAINTLIB off the root directory on the current drive.
  494.  
  495.         CTRL-K-X or
  496.         ESC      - Quit the  editor. Do  not save file. Leave flag set that
  497.                    indicates changes if they have been made. 
  498.  
  499.         CTRL-K-Q - Quit  the  editor.  Do  not  save  file.  Reset  flag to
  500.                    indicate no changes have been made.
  501.  
  502.         CTRL-K-D or
  503.         ALT/X    - Quit the editor, save file if changes have been made.
  504.  
  505.         CTRL-K-S or
  506.         ALT/S or
  507.         ALT/W    - Save the current file and continue editing.
  508.  
  509.         ALT/L or
  510.         ALT/R    - Reload   the   current   file   and   continue  editing,
  511.                    overwriting any changes made.
  512.  
  513.         CTRL-Y or
  514.         ALT/D    - Delete current line.
  515.  
  516.         CTRL-N   - Insert a carriage return  and  leave  cursor  at current
  517.                    line.
  518.  
  519.         CTRL-K-B - Mark block beginnng. Same as the first time you hit F4.
  520.  
  521.         CTRL-K-K - Mark block end. Same as the second time you hit F4.
  522.  
  523.         CTRL-Q-B - Go to block beginning.
  524.  
  525.         CTRL-Q-K - Go to block end.
  526.  
  527.         CTRL-K-C - Copy a block. Same as F5.
  528.  
  529.         CTRL-K-V - Move a block. Same as F6.
  530.  
  531.         CTRL-K-R - Read block at cursor position. Same as F7.
  532.  
  533.         CTRL-K-W - Write block. Same as F8.
  534.  
  535.         CTRL-K-Y - Delete highlighted block. 
  536.  
  537.         CTRL-HOME or
  538.         CTRL-Q-R - Go to top of file.
  539.  
  540.         CTRL-END or
  541.         CTRL-Q-C - Go to end of file.
  542.  
  543.         CTRL-RIGHT ARROW or
  544.         CTRL-F   - Skip word right.
  545.  
  546.         CTRL-LEFT ARROW or
  547.         CTRL-A   - Skip word left.
  548.  
  549.         CTRL-Q-S or
  550.         HOME     - Go to beginning of line.
  551.  
  552.         CTRL-Q-D or
  553.         END      - Go to end of line.
  554.  
  555.         INS      - Turns insert mode on and off.
  556.  
  557.         DEL      - Deletes character under cursor and adjusts text.
  558.  
  559.         ARROW  KEYS  /  PGUP  / PGDN and Wordstar(tm) 'Diamond' equivalents
  560.         move cursor around document.
  561.  
  562.         Now that you know how to use the editor, let's  see exactly  how to
  563.         make a demo...
  564.  
  565.                                Simple GRASP Tutorial
  566.  
  567.         Loading and displaying a picture:
  568.  
  569.         It  is  important  to  understand  that  GRASP  is very much a LINE
  570.         oriented programming pseudo-language.  It  is  called  this because
  571.         inter-line  dependencies  have  been  kept to a minimum. In simpler
  572.         terms, GRASP interprets one line at a time, executes it,  then goes
  573.         and  gets  the  next  line.  Except  for  a few special cases, what
  574.         happens on each line is relatively independent of the previous line
  575.         or the next line. This is important because if you understand this,
  576.         then creating a GRASP  program  will  be  easier  to  understand in
  577.         concept.
  578.  
  579.         Each line can start with only one of three things:
  580.  
  581.         1) A GRASP command. (PRESS F2 to see all the GRASP commands)
  582.  
  583.         2) A semicolon - ';'. This indicates the beginning of a comment.
  584.  
  585.         3) A  label. This  can be any continuous string of ASCII characters
  586.         with the exception of space, and must be followed by a colon - ':'.
  587.  
  588.         This keeps  the GRASP  interpreter's job  simple. It  either sees a
  589.         command,  and  immediately  looks  for  possible  parameters,  or a
  590.         semicolon, in which case  it ignores  the rest  of that  line, or a
  591.         label, which it puts into a list so it can find it later if needed.
  592.         Any  variation  from  these  three  options  will  result  in GRASP
  593.         thinking that what you typed was  a GRASP  command which  it cannot
  594.         understand, and results in an 'INVALID COMMAND IN LINE XXX' message
  595.         when you try to execute the program.
  596.  
  597.         Usually, you will want to start you GRASP  program with  a comment,
  598.         like a title of your program or your name, etc. Type:
  599.  
  600.         ; DEMO Program for GRASP
  601.  
  602.         and press return. You now have written a 1-line GRASP program. 
  603.  
  604.         Exciting huh? I'll bet you can't wait for more.
  605.  
  606.         The very  first command  in every  GRASP program  should be a VIDEO
  607.         command which tells GRASP which video mode you want to  use. If you
  608.         select a  video mode  that is not available on your computer, GRASP
  609.         will try to understand and tell you so.  If you  get wierd results,
  610.         or  the  screen  seems  to  go  crazy,  don't worry, just check the
  611.         reference section of this manual to be sure  you are  using a valid
  612.         video mode.  For this  tutorial, we  will assume that your computer
  613.         has an IBM Color Graphics Adapter  or compatible,  and we  will use
  614.         the standard 4 color 320x200 mode, which GRASP understands as video
  615.         mode A. Type the  following (exactly  as spelled  below, with upper
  616.         case):
  617.  
  618.  
  619.         ; DEMO Program for GRASP
  620.         ;
  621.         video Q
  622.  
  623.         Now press F10 to execute the program. (By the way, all this does is
  624.         set the video mode and come  back to  the editor.  Not too exciting
  625.         yet, but we're getting there...)
  626.  
  627.         You should get a message that says
  628.  
  629.                            Illegal argument(s) at line 3
  630.                                  File TMPFILE.TXT
  631.                              Press any Key to Continue
  632.  
  633.         Any time you see the message, it means that the command you entered
  634.         was correct, but one of the arguments you entered was incorrect.
  635.         Press a key and you will  be returned  back to  the editor,  to the
  636.         line where  the error  occured. The  problem here  is that  Q is an
  637.         invalid video mode. Change it to A (which stands for  CGA 320x200 4
  638.         color mode)  and press  F10 again. Your screen should blink and the
  639.         you will be put back in the editor.  
  640.  
  641.         Now we have named the program and set up a video mode, so it's time
  642.         to try  out some  graphics commands.  On the distribution disk is a
  643.         picture named  GRASP.PIC.  This  is  a  4  color  picture  from the
  644.         CGADEMO.GL file.  Let's load  it into  GRASP and display it using a
  645.         variety of fades.
  646.  
  647.         ; DEMO Program for GRASP
  648.         ;
  649.         video A
  650.         ;
  651.         pload grasp,1                    ; load picture into buffer #1
  652.         pfade 0,1,0,0                    ; fade it to the screen using fade
  653.                                          ;  #0
  654.         waitkey                           ; wait for a keypress before     
  655.                                          ;  returning to the editor.
  656.  
  657.         now, press F10 and you should see the GRASP.PIC picture  loaded and
  658.         displayed. 
  659.  
  660.         Change  the  first  parameter  of  the  pfade command to any number
  661.         between 0 and 25 and watch all the different special  effects. Then
  662.         to slow  things down, try a number like 50 for the third parameter,
  663.         which is the speed of the fade. Speed  seems to  have no  effect on
  664.         some fades,  while on others, it makes a lot of difference. This is
  665.         because of the nature of  each  individual  fade.  To  optimize the
  666.         performance of GRASP, it was decided that speed would be a relative
  667.         number, that is, relative to the actual fade.  This way,  each fade
  668.         may be accurately controlled from its fastest speed to its slowest.
  669.  
  670.         Let's do one more command, the  WINDOW command.  Window means don't
  671.         allow  any  part  of  the  picture  that lies outside of a specific
  672.         rectangle to be faded to the screen. Add the window command to your
  673.         demo program as follows:
  674.  
  675.         ; DEMO Program for GRASP
  676.         ;
  677.         video A
  678.         ;
  679.         pload grasp,1                    ; load picture into buffer #1
  680.         window 0,0,100,100               ; set fade clip window
  681.         pfade 0,1,0,0                    ; fade it to the screen using fade
  682.                                          ;  #0
  683.         waitkey                          ; wait for a keypress before
  684.                                          ;  returning to the editor.
  685.  
  686.         now press F10 and watch the  difference. You  should see  that only
  687.         the lower  left part  of your picture was actually dissolved to the
  688.         screen. Change the coordinates of the window command  and watch the
  689.         results.
  690.  
  691.         One  other  note:  The  window  command  can  only  operate on byte
  692.         boundaries. For most video modes, this means every 8 pixels  in the
  693.         x  direction.   You  don't   have  to  worry  because  WINDOW  will
  694.         automatically adjust itself to a byte boundary.
  695.           
  696.         This concludes this lesson.  Other  commands  in  GRASP  work  in a
  697.         similar fashion.  Experiment with them. Just remember to keep track
  698.         of your video modes and buffers.  You may  also want  to take apart
  699.         the demo program, CGADEMO.GL using the GLIB.EXE utility and look at
  700.         the code for more examples.
  701.  
  702.  
  703.                     Running the library file version - GRASPRT
  704.  
  705.  
  706.         The Library file, or runtime version of the program is identical to
  707.         the  text  file  version  except  that  the  interpreter  gets  its
  708.         information from  a library  file instead  of the  current disk and
  709.         directory. The  GLIB utility  will put all of your .PIC, .CLP, .SET
  710.         and .TXT files into a library  with the  extension GL.  To run your
  711.         demo execute the command:
  712.  
  713.         GRASPRT <libfile> <textfile>
  714.  
  715.         If  the  textfile  is  omitted  from  the  command line, GRASP will
  716.         execute the first text file it finds in the library.
  717.  
  718.         To run the demo that comes with GRASP, type:
  719.  
  720.         GRASPRT CGADEMO
  721.  
  722.                      Using the GRASP Graphics Librarian - GLIB
  723.  
  724.         The Graphics LIBrarian, GLIB.EXE, is used in the following manner:
  725.  
  726.         GLIB [-dstuea] libname [files...]  
  727.  
  728.         where the following commands are supported:
  729.  
  730.          -d   delete file from library
  731.          -s   extended file list
  732.          -t   quick file list
  733.          -u   update (add) file to library
  734.          -e   extract file from library
  735.          -a   extract all files from library
  736.  
  737.         For example, if you  wanted to  put all  of the  .PIC files  in the
  738.         current directory into a library file named MYFILE, you would type:
  739.  
  740.         GLIB -u MYFILE *.PIC
  741.  
  742.         Or if you wanted to extract GRASP.PIC from the library CGADEMO, you
  743.         would type:
  744.  
  745.         GLIB -e CGADEMO GRASP.PIC
  746.  
  747.         Be  sure that all files  needed for  your demo  are in  the library
  748.         file  before  you  try  to  run  it.  Otherwise,  you may get error
  749.         messages.
  750.  
  751.         NOTE:
  752.         You cannot use  wild  cards  for  extracting  or  deleting  in this
  753.         version (1.0)  of GLIB.  However, you may use wild cards for adding
  754.         to or updating the library.
  755.  
  756.         More Examples:
  757.  
  758.         GLIB -d DEMO FRED.TXT
  759.  
  760.         will delete the file 'fred.txt' from library file DEMO.GL
  761.  
  762.         GLIB -e DEMO LOGO.CLP
  763.  
  764.         will extract the clipping 'logo.clp' from library file DEMO.GL
  765.  
  766.         GLIB -u DEMO MTX.CLP
  767.  
  768.         will add/replace the picture 'mtx.pic' to library file DEMO.GL
  769.  
  770.  
  771.  
  772.  
  773.                          The commands of GRASP - Detailed
  774.  
  775.  
  776. BOX                                                            BOX
  777.  
  778.  
  779.         Summary:
  780.         -------
  781.  
  782.         BOX allows you to draw a box on the screen  in the  current drawing
  783.         color.
  784.  
  785.  
  786.         Syntax:
  787.         ------
  788.  
  789.         BOX startx, starty, endx, endy, <width>
  790.  
  791.         where 'startx'  and 'starty'  is the point of one corner of the box
  792.         and 'endx' and endy'  is the  point of  the opposite  corner of the
  793.         box. Width  is the  number of  pixels wide  you want the box to be.
  794.         Width is drawn 'inward' from the original box. 
  795.  
  796.  
  797.         Example:
  798.         -------
  799.  
  800.         BOX 0,0,100,100
  801.  
  802.         will draw a box in the  current  drawing  color  from  x=0,  y=0 to
  803.         x=100, y=100.
  804.  
  805.  
  806.         Comments:
  807.         --------
  808.  
  809.         Transparent mode  does not affect this command. Default width is 1.
  810.         BOX is not available in text modes.
  811.  
  812. CFADE                                                        CFADE
  813.  
  814.  
  815.         Summary:
  816.         -------
  817.  
  818.         CFADE allows you to dissolve or fade a clipping to  the screen. You
  819.         may specify  one of several dissolves, the speed for that dissolve,
  820.         and a delay after the dissolve. This command  is similar  to PFADE,
  821.         but applies  to clippings. The same 25 fades that apply to pictures
  822.         also apply to clippings.
  823.  
  824.  
  825.         Syntax:
  826.         ------
  827.  
  828.         CFADE fade number, x, y, <buffer number>, <speed>, <delay>
  829.  
  830.         where 'fade  number' is  the number  of the  fade you  want to use,
  831.         'buffer number'  is the  clipping buffer  number where the clipping
  832.         you want to fade has been loaded, 'x' and 'y' are the  location for
  833.         the clipping  to be  faded, 'speed'  is the  speed of  the fade and
  834.         'delay' is the time to wait after the  delay. Speed  can be  in the
  835.         range 0-10000. Check Appendix B for a list of fades.
  836.  
  837.  
  838.         Example:
  839.         -------
  840.  
  841.         CFADE 2,20,40,5,500,1000
  842.  
  843.         will fade  the clipping  in buffer 5 using fade 2 at location x=24,
  844.         y=40 at speed 500, and then  wait 10  seconds. The  delay works the
  845.         same as using the WAITKEY command. 
  846.  
  847.  
  848.         Comments:
  849.         --------
  850.  
  851.         Note: CFADE only fades byte-width clippings and puts them up at the
  852.         nearest byte boundary to the x  and  y  specified  in  the command.
  853.         Deviations may cause unpredictable results. Use the utility WHATCLP
  854.         to obtain the needed  information  about  your  clippings.  If your
  855.         clipping  is  not  byte-width,  it  will  fill  the  right  edge to
  856.         byte-width with white (highest  color available).  Transparent mode
  857.         does NOT apply to CFADE. 
  858.  
  859.         Default values for optional parameters:
  860.  
  861.         buffer number: 1
  862.         speed:         0
  863.         delay:         0
  864.  
  865.  
  866. CFREE                                                        CFREE
  867.  
  868.  
  869.         Summary:
  870.         -------
  871.  
  872.         CFREE is  used to free-up a clipping buffer. Sometimes, you may run
  873.         out of memory and need to clear up  some buffers  you have  full of
  874.         clippings you have already used.
  875.  
  876.  
  877.         Syntax:
  878.         ------
  879.  
  880.         CFREE buf1, <buf2>, <buf3>...
  881.  
  882.         where 'buf1' and other buffers are buffers you want to free-up.
  883.  
  884.  
  885.         Example:
  886.         -------
  887.  
  888.         CFREE 1,4,12
  889.  
  890.         will free-up clipping buffers 1, 4 and 12.
  891.  
  892.         CFREE 1,-,16
  893.  
  894.         will free-up buffers 1 through 16. You MUST use commas or spaces to
  895.         separate these parameters.
  896.  
  897.  
  898.         Comments:
  899.         --------
  900.  
  901.         This is especially useful in  EGA  16  color  mode  where  space is
  902.         critical.
  903.  
  904.  
  905. CHGCOLOR                                                  CHGCOLOR
  906.  
  907.  
  908.         Summary:
  909.         -------
  910.  
  911.         Chgcolor is  used to  set the color palette registers in IBM EGA 16
  912.         color mode. On the  EGA, there  are 16  possible colors,  called an
  913.         'index', and  each of  these color  indices may  be one of 64 color
  914.         'values'.
  915.  
  916.  
  917.         Syntax:
  918.         ------
  919.  
  920.         CHGCOLOR color index, color value,...
  921.  
  922.         where 'color index' refers to the color number  you want  to change
  923.         in the range 0-15 and 'color value' lies in the range 0-63.
  924.  
  925.  
  926.         Example:
  927.         -------
  928.  
  929.         CHGCOLOR 3,32
  930.  
  931.         will change color index 3 to color value 32.
  932.  
  933.  
  934.         Comments:
  935.         --------
  936.  
  937.         Remember, this only works in EGA 16 color modes.
  938.  
  939.  
  940. CIRCLE                                                      CIRCLE
  941.  
  942.  
  943.         Summary:
  944.         -------
  945.  
  946.         CIRCLE allows  you to draw a circle or ellipse on the screen in the
  947.         current drawing color. The  color parameters  must be  specified in
  948.         pairs, as in the example.
  949.  
  950.  
  951.         Syntax:
  952.         ------
  953.  
  954.         CIRCLE centerx, centery, xradius, <yradius>
  955.  
  956.         where 'centerx'  and 'centery' is the center point of the circle or
  957.         ellipse, xradius' is the radius in the x-direction and 'yradius' is
  958.         the radius in the y direction.
  959.  
  960.  
  961.         Example:
  962.         -------
  963.  
  964.         CIRCLE 100,100,100,20
  965.  
  966.         will draw a circle centered at x=100, y=100 with x radius=100 and y
  967.         radius=20.
  968.  
  969.  
  970.         Comments:
  971.         --------
  972.  
  973.         Transparent mode does not affect this command. Failure to specify a
  974.         yradius assumes yradius=xradius and a circle is produced. Note also
  975.         that circle  here implies  xradius=yradius which,  depending on the
  976.         aspect  ratio  of  your  current  video  mode, may not be a circle.
  977.         CIRCLE is not available in text modes.
  978.  
  979.  
  980. CLEARSCR                                                  CLEARSCR
  981.  
  982.  
  983.         Summary:
  984.         -------
  985.  
  986.         Clearscr is used to clear the screen to the current drawing color.
  987.  
  988.  
  989.         Syntax:
  990.         ------
  991.  
  992.         CLEARSCR
  993.  
  994.  
  995.         Example:
  996.         -------
  997.  
  998.         CLEARSCR
  999.  
  1000.         will clear the screen to the current drawing  color (the  color set
  1001.         with the last COLOR command).
  1002.  
  1003.  
  1004.         Comments:
  1005.         --------
  1006.  
  1007.  
  1008. CLOAD                                                        CLOAD
  1009.  
  1010.  
  1011.         Summary:
  1012.         -------
  1013.  
  1014.         This command  is used  to load  a clipping into a buffer. There are
  1015.         128 buffers available for  clippings in  GRASP. It  is advised, for
  1016.         memory  reasons,  that  the  user  try  to  manage  using as few as
  1017.         possible. A clipping must be loaded into a buffer before  it can be
  1018.         dissolved or put up onto the screen.
  1019.  
  1020.  
  1021.         Syntax:
  1022.         ------
  1023.  
  1024.         CLOAD clipping, buffer number, <shiftparm>
  1025.  
  1026.         where 'clipping'  is the name of the clipping you want to load (the
  1027.         file name extension is optional) and 'buffer number'  is the number
  1028.         of the  buffer you  want to  load in to. Valid buffer numbers are 1
  1029.         through 128. Buffer 0 is non-existent  for clippings,  and thus, no
  1030.         clipping may  be loaded  into it.  'Shiftparm' indicates whether or
  1031.         not to create the  shifted copies  necessary to  place clippings at
  1032.         non-byte boundaries. Default for shiftparm is 0 or YES. Placing a 1
  1033.         here will cause GRASP  not to  create the  shifted copies  and thus
  1034.         saving memory.  This is useful if you know that you are going to be
  1035.         using CFADE on this clipping and therefore couldn't use the shifted
  1036.         copies anyway.
  1037.  
  1038.  
  1039.         Example:
  1040.         -------
  1041.  
  1042.         CLOAD myclip,5
  1043.  
  1044.         will load the clipping myclip.clp into clipping buffer number 5.
  1045.  
  1046.  
  1047.         Comments:
  1048.         --------
  1049.  
  1050.         If you  do not understand the concept of shifted copies, it is best
  1051.         not to fool around with the shiftparm parameter.  Note also  that a
  1052.         file extension  is not  necessary in  your GRASP file. Drive letter
  1053.         and path may be specified.
  1054.  
  1055.  
  1056. COLOR                                                        COLOR
  1057.  
  1058.  
  1059.         Summary:
  1060.         -------
  1061.  
  1062.         COLOR allows you to choose a drawing color.  Drawing color  is used
  1063.         for  drawing  primitives  (such  as  line,  box, circle, or point),
  1064.         transparent mode selection, text  strings and  clearing the screen.
  1065.         Secondary color is used for background color in text mode or shadow
  1066.         color for font styles in graphics modes.
  1067.  
  1068.  
  1069.         Syntax:
  1070.         ------
  1071.  
  1072.         COLOR n1,<n2>
  1073.  
  1074.         where 'n1' is the drawing color and 'n2' is the secondary color.
  1075.  
  1076.  
  1077.         Example:
  1078.         -------
  1079.  
  1080.         COLOR 3,0
  1081.  
  1082.         will set the current  drawing color  to color  3 and  the secondary
  1083.         color to 0.
  1084.  
  1085.  
  1086.         Comments:
  1087.         --------
  1088.  
  1089.         Related  commands  are  LINE,  BOX,  CIRCLE, POINT, TRAN, CLEARSCR,
  1090.         PALETTE, MODE and PFADE. The secondary color is used for the bottom
  1091.         character in  shadow text strings and the background color for text
  1092.         screens. Secondary color defaults to color 0 if not specified.
  1093.  
  1094.  
  1095. EXEC                                                          EXEC
  1096.  
  1097.  
  1098.         Summary:
  1099.         -------
  1100.         This command allows you to execute another program from within your
  1101.         GRASP program.  Useful for utility programs, or custom programs you
  1102.         write that provide a function that GRASP does not.
  1103.  
  1104.  
  1105.         Syntax:
  1106.         ------
  1107.  
  1108.         EXEC program, <parameters>
  1109.  
  1110.         where 'program' is the name of the program you wish to execute. You
  1111.         MUST include  path if  it is  in a  different path, and all program
  1112.         names must include the extension. 'Parameters' are any command line
  1113.         parameters you would normally pass to the program.
  1114.  
  1115.  
  1116.         Example:
  1117.         -------
  1118.  
  1119.         EXEC \PAINTLIB\PCPAINT.EXE, /O
  1120.  
  1121.         will execute  pcpaint from  the \paintlib  directory on the current
  1122.         drive passing the /O parameter.
  1123.  
  1124.  
  1125.         Comments:
  1126.         --------
  1127.  
  1128.         You MUST include full path and file extension.
  1129.  
  1130.  
  1131. EXIT                                                          EXIT
  1132.  
  1133.  
  1134.         Summary:
  1135.         --------
  1136.  
  1137.         Exit will  cause the  currently running  GRASP program  to quit and
  1138.         return to DOS or the GRASP editor.
  1139.  
  1140.  
  1141.         Syntax:
  1142.         ------
  1143.  
  1144.         EXIT
  1145.  
  1146.  
  1147.         Example:
  1148.         -------
  1149.  
  1150.         EXIT
  1151.  
  1152.         will  cause  the  currently  running GRASP program to terminate and
  1153.         return to DOS or the GRASP editor.
  1154.  
  1155.  
  1156.         Comments:
  1157.         --------
  1158.  
  1159.         If you are running  GRASPRT, EXIT  returns you  to DOS.  If you are
  1160.         running GRASP,  EXIT returns  you to  the editor  or the main menu,
  1161.         depending on how you ran the program.
  1162.  
  1163.  
  1164.  
  1165. FFREE                                                        FFREE
  1166.  
  1167.  
  1168.         Summary:
  1169.         -------
  1170.  
  1171.         This command will free up the font buffer  so that  more memory may
  1172.         be available for pictures and clippings.
  1173.  
  1174.  
  1175.         Syntax:
  1176.         ------
  1177.  
  1178.         FFREE
  1179.  
  1180.  
  1181.         Example:
  1182.         -------
  1183.  
  1184.         FFREE
  1185.  
  1186.         will free up the font buffer.
  1187.  
  1188.  
  1189.         Comments:
  1190.         --------
  1191.  
  1192.  
  1193. FGAPS                                                        FGAPS
  1194.  
  1195.  
  1196.         Summary:
  1197.         -------
  1198.  
  1199.         This command  allows you  to set the gaps between characters in the
  1200.         text command and also the width of the space character.
  1201.  
  1202.  
  1203.         Syntax:
  1204.         ------
  1205.  
  1206.         FGAPS <char gap, space gap>
  1207.  
  1208.         where 'char gap is the  number  of  pixels  between  characters and
  1209.         'space gap' is the number of pixels wide for the space character.
  1210.  
  1211.  
  1212.         Example:
  1213.         -------
  1214.  
  1215.         FGAPS 3,9
  1216.  
  1217.         will  set  the  inter-character  gap  to  3  pixels  and  the space
  1218.         character to a width of 9 pixels.
  1219.  
  1220.  
  1221.         Comments:
  1222.         --------
  1223.  
  1224.         Note that this has no effect on the TEXT command if you are in TEXT
  1225.         mode. FGAPS  with no parameters resets the gaps to the default gaps
  1226.         for the currently loaded font.
  1227.  
  1228.  
  1229. FLOAD                                                        FLOAD
  1230.  
  1231.  
  1232.         Summary:
  1233.         -------
  1234.  
  1235.         This command is used to load in a  character set.  The GRASP system
  1236.         only allows  1 character set in memory at a time. After a character
  1237.         set has been loaded,  TEXT  commands  (see  command  TEXT)  will be
  1238.         performed using the currently loaded font. Applies only to graphics
  1239.         modes.
  1240.  
  1241.  
  1242.         Syntax:
  1243.         ------
  1244.  
  1245.         FLOAD fontname
  1246.  
  1247.         where 'fontname'  is the  name of  the FONTRIX(tm)  or PCPAINT font
  1248.         file you wish to load. File name extensions are optional.
  1249.  
  1250.  
  1251.         Example:
  1252.         -------
  1253.  
  1254.         FLOAD bocklin
  1255.  
  1256.         will load  the FONTRIX(tm)  font bocklin.set into memory for use by
  1257.         the TEXT command.
  1258.  
  1259.  
  1260.         Comments:
  1261.         --------
  1262.  
  1263.         When a font is loaded with FLOAD, the gaps are reset to the default
  1264.         gaps  for  that  font.  So  be  sure  to reset gaps using the FGAPS
  1265.         command if the default gaps aren't adequate. 
  1266.  
  1267.  
  1268. FLOAT                                                        FLOAT
  1269.  
  1270.  
  1271.         Summary:
  1272.         -------
  1273.  
  1274.         FLOAT allows you to  animate  a  clipping  or  series  of clippings
  1275.         between any two points on the screen with one command. It
  1276.         is similar  to FLY  except that it performs an exchange with screen
  1277.         data so that the background may be preserved. 
  1278.  
  1279.         Syntax:
  1280.         ------
  1281.  
  1282.         FLOAT startx, starty, endx,  endy, increment,  delay, clip1, clip2,
  1283.         ...clipn
  1284.  
  1285.         where 'startx' and 'starty' indicate the starting point, 'endx' and
  1286.         'endy' indicate  the  ending  point,  'increment'  is  the distance
  1287.         between each  put along  the line, 'delay' is the wait time between
  1288.         each put and 'clip1-clipn' is the list of clippings. 
  1289.  
  1290.  
  1291.         Example:
  1292.         -------
  1293.  
  1294.         FLOAT 0,0,200,200,2,10,1,2,3
  1295.  
  1296.         will 'FLOAT' the clippings 1,2 and  3   in that  order from  0,0 to
  1297.         200,200, skipping  2 pixels between each put, waiting a count of 10
  1298.         between each put. For example, clip 1 will  be put  at 0,0,  clip 2
  1299.         will be  put at  clip 2,2, clip 3 will be put a 4,4, clip 1 will be
  1300.         put at 6,6, clip2 will be put at 8,8, etc.
  1301.  
  1302.  
  1303.         Comments:
  1304.         --------
  1305.  
  1306.         This command differs from FLY in that it  preserves the background.
  1307.         Also note  that the  last operation  it performs  is the swap-back,
  1308.         which restores screen data. This means that if  you want  to have a
  1309.         clipping on  the screen after the FLOAT command, you have to follow
  1310.         the FLOAT with a  PUTUP command.  Selective use  of transparent can
  1311.         yield very interesting results.
  1312.  
  1313.  
  1314.  
  1315. FLY                                                            FLY
  1316.  
  1317.  
  1318.         Summary:
  1319.         -------
  1320.  
  1321.         FLY allows you to animate a clipping or series of clippings between
  1322.         any two points on the screen with one command.
  1323.  
  1324.  
  1325.         Syntax:
  1326.         ------
  1327.  
  1328.         FLY startx, starty, endx,  endy,  increment,  delay,  clip1, clip2,
  1329.         ...clipn
  1330.  
  1331.         where 'startx' and 'starty' indicate the starting point, 'endx' and
  1332.         'endy' indicate  the  ending  point,  'increment'  is  the distance
  1333.         between each  put along  the line, 'delay' is the wait time between
  1334.         each put and  'clip1-clipn'  is  the  list  of  clippings.  You may
  1335.         animate up to 10 clippings.
  1336.  
  1337.  
  1338.         Example:
  1339.         -------
  1340.  
  1341.         FLY 0,0,200,200,2,10,1,2,3
  1342.  
  1343.         will  'fly'  the  clippings  1,2  and  3  in that order from 0,0 to
  1344.         200,200, skipping 2 pixels between each put, waiting a count  of 10
  1345.         between each  put. For  example, clip  1 will be put at 0,0, clip 2
  1346.         will be put at clip 2,2, clip 3 will be put a  4,4, clip  1 will be
  1347.         put at 6,6, clip2 will be put at 8,8, etc.
  1348.  
  1349.  
  1350.         Comments:
  1351.         --------
  1352.          
  1353.         Selective use  of slightly larger than necessary clippings (to wipe
  1354.         out  the    previous  put)  and  transparent  mode  can  yield very
  1355.         interesting results.
  1356.  
  1357.  
  1358. FSTYLE                                                       FSTYLE
  1359.  
  1360.  
  1361.         Summary:
  1362.         -------
  1363.  
  1364.         This command allows you to choose a style for the characters in the
  1365.         TEXT command. Styles are as follows:
  1366.  
  1367.         style #    style
  1368.         -------    -----
  1369.            0       Default, normal letters
  1370.            1       Bold up.
  1371.            2       Bold right.
  1372.            3       Shadow up right.
  1373.            4       Shadow up left.
  1374.            5       Shadow up right 2 pixels.
  1375.            6       Shadow up left 2 pixels.
  1376.  
  1377.  
  1378.         Syntax:
  1379.         ------
  1380.  
  1381.         FSTYLE fstyle
  1382.  
  1383.         where fstyle is the number of the desired style.
  1384.  
  1385.  
  1386.         Example:
  1387.         -------
  1388.  
  1389.         FSTYLE 4
  1390.  
  1391.         will set the text style to shadow up left.
  1392.  
  1393.  
  1394.         Comments:
  1395.         --------
  1396.         Use of the command with no parameters will default to style 0.
  1397.  
  1398.  
  1399. GOSUB                                                        GOSUB
  1400.  
  1401.  
  1402.         Summary:
  1403.         -------
  1404.  
  1405.         This command allows the transfer of  control during  execution of a
  1406.         GRASP program  to a  sub-program defined  elsewhere in the program.
  1407.         This is similar to a BASIC gosub command. The subprogram is defined
  1408.         by a  label at the beginning, and a RETURN command at the end. When
  1409.         the  RETURN  is  encountered,  control  is  returned  to  the  line
  1410.         following the line where the GOSUB ocurred.
  1411.  
  1412.  
  1413.         Syntax:
  1414.         ------
  1415.  
  1416.         GOSUB subroutine
  1417.  
  1418.         where 'subroutine'  is a sub-program defined elsewhere in the GRASP
  1419.         program.
  1420.  
  1421.  
  1422.         Example:
  1423.         -------
  1424.  
  1425.         GOSUB myprog
  1426.  
  1427.         will transfer control to  the  sub-program  'myprog'.  Control will
  1428.         return when the statement RETURN in encountered in the sub-program.
  1429.  
  1430.  
  1431.         Comments:
  1432.         --------
  1433.  
  1434.         Also see command RETURN.
  1435.  
  1436.  
  1437. GOTO                                                          GOTO
  1438.  
  1439.  
  1440.         Summary:
  1441.         -------
  1442.  
  1443.         This command  allows you  to transfer control of a GRASP program to
  1444.         another portion of the program,  similar  to  the  same  command in
  1445.         BASIC. You  must first  define a  label at the point you want to go
  1446.         to. Labels are defined  as any  string of  less than  16 characters
  1447.         terminated by a colon (:).
  1448.  
  1449.  
  1450.         Syntax:
  1451.         ------
  1452.  
  1453.         GOTO label
  1454.  
  1455.         where 'label' is defined somewhere else in the program.
  1456.  
  1457.  
  1458.         Example:
  1459.         -------
  1460.  
  1461.         GOTO here
  1462.  
  1463.         will  transfer  control  to  the  line which begins with the string
  1464.         'here:'. There may only be one  label of  a particular  name in one
  1465.         GRASP program. 
  1466.  
  1467.  
  1468.         Comments:
  1469.         --------
  1470.  
  1471.         You may have up to 512 labels in a GRASP program.  
  1472.  
  1473.  
  1474. IFKEY                                                        IFKEY
  1475.  
  1476.  
  1477.         Summary:
  1478.         -------
  1479.  
  1480.         IFKEY allows  conditional branching by means of an implied goto. If
  1481.         the key indicated in  the  command  matches  the  last  key pressed
  1482.         during a waitkey command, branching occurs.
  1483.  
  1484.  
  1485.         Syntax:
  1486.         ------
  1487.  
  1488.         IFKEY key label
  1489.  
  1490.         where  key  is  the  key  code  to  compare to and label is a label
  1491.         defined elsewhere in the program.
  1492.  
  1493.  
  1494.         Example:
  1495.         -------
  1496.  
  1497.         IFKEY 1 part1
  1498.  
  1499.         means that if, during  the last  waitkey command,  the '1'  key was
  1500.         pressed, goto label "PART1".
  1501.  
  1502.  
  1503.         Comments:
  1504.         --------
  1505.  
  1506.         LINE                                                          LINE
  1507.  
  1508.  
  1509.         Summary:
  1510.         -------
  1511.  
  1512.         LINE allows  you to draw a single pixel width line on the screen in
  1513.         the current drawing color.
  1514.  
  1515.  
  1516.         Syntax:
  1517.         ------
  1518.  
  1519.         LINE startx, starty, endx, endy
  1520.  
  1521.         where 'startx' and 'starty' is the location for the first  point in
  1522.         the line  and 'endx'  and 'endy' is the location for the last point
  1523.         in the line.
  1524.  
  1525.  
  1526.         Example:
  1527.         -------
  1528.  
  1529.         LINE 0,0,100,100
  1530.  
  1531.         will draw a line in the  current drawing  color from   x=0,  y=0 to
  1532.         x=100, y=100.
  1533.  
  1534.  
  1535.         Comments:
  1536.         --------
  1537.  
  1538.         Transparent  mode  does  not  affect  this  command.  LINE  is  not
  1539.         available in text modes.
  1540.  
  1541.  
  1542. LINK                                                          LINK
  1543.  
  1544.  
  1545.         Summary:
  1546.         -------
  1547.  
  1548.         This command is used to link to another  text command  file. IF you
  1549.         wish  to  have  several  special effects, and for editing purposes,
  1550.         keep them is separate ASCII files, you may  link them  during GRASP
  1551.         run time with this command.
  1552.  
  1553.  
  1554.         Syntax:
  1555.         ------
  1556.  
  1557.         LINK txtfile
  1558.  
  1559.         where  'txtfile'  is  the  name  of  the  command  file you wish to
  1560.         execute. File  name  extensions  are  not  required,  but  all text
  1561.         command files must have an extension of txt.
  1562.  
  1563.  
  1564.         Example:
  1565.         -------
  1566.  
  1567.         LINK race
  1568.  
  1569.         will  link  to  the  text  command  file  'race.txt'  and  continue
  1570.         executing.
  1571.  
  1572.  
  1573.         Comments:
  1574.         --------
  1575.  
  1576.         Since this command requires  interpretation of  the command itself,
  1577.         the loading  of a  new file,  and the  interpretation of the second
  1578.         file, it has a tendency to slow things down. It is recommended that
  1579.         all  commands  be  put  into  one file before giving a presentation
  1580.         using GRASP. This command is useful  during development,  or if you
  1581.         have stored  several effects  from previous demonstrations and want
  1582.         to link them together.
  1583.  
  1584.  
  1585. LOOP                                                          LOOP
  1586.  
  1587.  
  1588.         Summary:
  1589.         -------
  1590.  
  1591.         This command causes the  GRASP  interpreter  to  loop  back  to the
  1592.         previous mark.  This will  happen n number of times, where n is the
  1593.         number specified in the previous MARK command.
  1594.  
  1595.  
  1596.         Syntax:
  1597.         ------
  1598.  
  1599.         LOOP
  1600.  
  1601.  
  1602.         Example:
  1603.         -------
  1604.  
  1605.         LOOP
  1606.  
  1607.         will loop to previous mark.
  1608.  
  1609.  
  1610.         Comments:
  1611.         --------
  1612.  
  1613.         MARK/LOOP pairs may be nested up to 16 levels deep.
  1614.  
  1615.  
  1616. MARK                                                         MARK
  1617.  
  1618.  
  1619.         Summary:
  1620.         -------
  1621.  
  1622.         This command is used to mark a position which will be the  top of a
  1623.         loop. Coupled  with the LOOP command, MARK allows you to repeat the
  1624.         same steps in your GRASP command file a specified number of times.
  1625.  
  1626.  
  1627.         Syntax:
  1628.         ------
  1629.  
  1630.         MARK xxx
  1631.  
  1632.         where 'xxx' is the number of times you  wish to  loop back  to this
  1633.         mark.
  1634.  
  1635.  
  1636.         Example:
  1637.         -------
  1638.  
  1639.         MARK 10
  1640.  
  1641.         will  place  a  mark  at  this  point  so that the next time a LOOP
  1642.         command is encountered, the program will  loop back  to this point.
  1643.         This process will occur ten times.
  1644.  
  1645.  
  1646.         Comments:
  1647.         --------
  1648.  
  1649.         MARK/LOOP pairs  may be  nested up  to 16  levels deep. The maximum
  1650.         number of times you can loop is 65535.
  1651.  
  1652.  
  1653. MODE                                                          MODE
  1654.  
  1655.  
  1656.         Summary:
  1657.         -------
  1658.  
  1659.         Mode is used in IBM CGA 4 color mode and IBM CGA 2 color mode only.
  1660.         It is used to set the palette and border color in these modes. 
  1661.  
  1662.  
  1663.         Syntax:
  1664.         ------
  1665.  
  1666.         MODE border color, palette
  1667.  
  1668.         where 'border  color' refers  to the  background color in IBM CGA 4
  1669.         color mode and foreground color in  IBM CGA  2 color  mode. 'Border
  1670.         color' can  be in  the range  0-15. Palette  affects only IBM CGA 4
  1671.         color mode and is in the range 0-5.  Refer to  the following tables
  1672.         for specifics.
  1673.  
  1674.  
  1675.         Border                                 Color Table
  1676.         Color    Color       Palette   1            2              3
  1677.         -----    -----       ------- -----------------------------------
  1678.           0      Black          0    Green        Red             Brown
  1679.           1      Blue           1    Cyan         Magenta         White
  1680.           2      Green          2    Cyan         Red             White
  1681.           3      Cyan           3    Bright Green Bright Red      Yellow
  1682.           4      Red            4    Bright Cyan  Bright Magenta  White
  1683.           5      Magenta        5    Bright Cyan  Bright Red      White
  1684.           6      Brown       -------------------------------------------
  1685.           7      Grey 
  1686.           8      Dark Grey (Bright Black)
  1687.           9      Bright Blue
  1688.          10      Bright Green
  1689.          11      Bright Cyan
  1690.          12      Bright Red
  1691.          13      Bright Magenta
  1692.          14      Yellow (Bright Brown)
  1693.          15      White (Bright Grey)
  1694.  
  1695.  
  1696.         In  the  above  Palette  table,  color  0 is the currently selected
  1697.         Border Color.
  1698.           
  1699.  
  1700.         Example:
  1701.         -------
  1702.  
  1703.         Mode 1,4
  1704.  
  1705.         will yield the following: (Assuming  we  are  in  IBM  CGA  4 color
  1706.         mode), border color is blue (Drawing Color 0), and the palette will
  1707.         be bright cyan, bright magenta, and white. (Drawing  colors 1,2 and
  1708.         3, respectively)  in IBM CGA 4 color mode. In IBM CGA 2 color mode,
  1709.         The foreground color will be blue.
  1710.  
  1711.  
  1712.         Comments:
  1713.         --------
  1714.  
  1715.         This command was intended for use only in IBM CGA  4 color  and IBM
  1716.         CGA 2  color modes.  Use in  any other  mode may result in an error
  1717.         message. 
  1718.  
  1719.  
  1720.  
  1721. NOISE                                                        NOISE
  1722.  
  1723.  
  1724.         Summary:
  1725.         -------
  1726.  
  1727.         NOISE allows you to make music in GRASP. By specifying starting and
  1728.         ending  frequencies,  as  well  as  a duration, you can make single
  1729.         notes, or complex sounds.
  1730.  
  1731.  
  1732.         Syntax:
  1733.         ------
  1734.  
  1735.         NOISE startfreq, endfreq, duration
  1736.  
  1737.         where 'startfreq' and 'startfreq' are the  starting frequencies for
  1738.         the noise and 'duration' is the overall length of the noise.
  1739.  
  1740.  
  1741.         Example:
  1742.         -------
  1743.  
  1744.         NOISE 440,440,100
  1745.  
  1746.         will play the note with a frequency 440 for duration 100.
  1747.  
  1748.  
  1749.         Comments:
  1750.         --------
  1751.  
  1752.  
  1753.  
  1754. OFFSET                                                      OFFSET
  1755.  
  1756.  
  1757.         Summary:
  1758.         -------
  1759.  
  1760.         The  OFFSET  command  allows  you  to  treat  coordinates  in other
  1761.         commands  (like  putup,  line,  box,  cfade,  etc...)  as  relative
  1762.         coordinates rather than absolute. If the OFFSET is set to 0,0, then
  1763.         the coordinates you enter in the other commands are relative to the
  1764.         screen as  a whole  which appears  to be  absolute. This command is
  1765.         used when you want to repeat a series of operations  but don't want
  1766.         to have  to alter  all the  coordinates in order to use a different
  1767.         region of the screen.
  1768.  
  1769.  
  1770.         Syntax:
  1771.         ------
  1772.  
  1773.         OFFSET x,y
  1774.  
  1775.         where 'x' and 'y' are the x and y offset values.
  1776.  
  1777.  
  1778.         Example:
  1779.         -------
  1780.  
  1781.         OFFSET 40,32
  1782.  
  1783.         will set the offset to x=40, y=32. This  means that  if you specify
  1784.         that you want a line drawn from 0,0 to 10,10, it will actually draw
  1785.         it from 40,32 to 50,42. In other words, the offset values are added
  1786.         to the coordinate data you type in the command.
  1787.  
  1788.  
  1789.         Comments:
  1790.         --------
  1791.  
  1792. PALETTE                                                    PALETTE
  1793.  
  1794.  
  1795.         Summary:
  1796.         -------
  1797.  
  1798.         Palette is used to set the current palette to that of the specified
  1799.         picture which has been loaded  into  a  buffer.  This  sets  the 16
  1800.         colors  out  of  64  on  EGA  16 color modes and the border-palette
  1801.         combination of CGA 4 color mode.
  1802.  
  1803.  
  1804.         Syntax:
  1805.         ------
  1806.  
  1807.         PALETTE buffer number
  1808.  
  1809.         Where 'buffer number' is the number  of  the  buffer  in  which the
  1810.         picture resides.
  1811.  
  1812.  
  1813.         Example:
  1814.         -------
  1815.  
  1816.         PALETTE 2
  1817.  
  1818.         will set  the current  palette to  the palette used for the picture
  1819.         which was loaded into buffer 2 with the PLOAD command.
  1820.  
  1821.  
  1822.         Comments:
  1823.         --------
  1824.  
  1825.         This command was intended for use in EGA  16 color  mode and  CGA 4
  1826.         color  mode  only.  Use  in  other  modes  may  cause unpredictable
  1827.         results. Use with caution.
  1828.  
  1829. PAN                                                           PAN
  1830.  
  1831.  
  1832.         Summary:
  1833.         -------
  1834.  
  1835.         This command allows you  to  perform  a  hardware  pan  if  you are
  1836.         operating in  one of  the EGA modes. If the picture you want to pan
  1837.         around on is larger than a screen then  the following  rules apply:
  1838.         1) You  MUST use  PFADE number 0 to put up the picture, 2) when you
  1839.         are finished panning and scrolling,  you  MUST  PFREE  the picture,
  1840.         clear the screen with CLEARSCR, then do a RESETSCR before using any
  1841.         other pictures. This is so that the EGA will be able to  keep track
  1842.         of which  picture you  are using  and how to best display it. Also,
  1843.         sequences  of  PAN  commands  should  always  return  you   to  the
  1844.         coordinate 0,0  when you  are done. Think of the picture as being a
  1845.         very large screen with the upper left corner  being coordinate 0,0.
  1846.         Pan  then  allows  you  to  change  upper  left  corner  to  be any
  1847.         coordinate in the valid coordinate space.
  1848.  
  1849.  
  1850.         Syntax:
  1851.         ------
  1852.  
  1853.         PAN x0,y0,x1,y1,buffer
  1854.  
  1855.         where 'x0', 'y0' is the starting  coordinate for  panning and 'x1',
  1856.         'y1' is  the ending coordinate. 'Buffer' is the picture buffer that
  1857.         the command will look into to get real picture coordinates  and set
  1858.         the EGA display modes to coincide to.
  1859.  
  1860.  
  1861.         Example:
  1862.         -------
  1863.  
  1864.         PAN 0,0,100,100,1
  1865.         PAN 100,100,0,0,1
  1866.  
  1867.         will smoothly  pan the screen diagonally from the upper left corner
  1868.         to 100,100 and back again.
  1869.  
  1870.  
  1871.         Comments:
  1872.         --------
  1873.  
  1874.         This is a complicated command  and  requires  some  thought  to use
  1875.         effectively. Be careful.
  1876.  
  1877.         CAUTION: It is imperative that you free the oversize picture buffer
  1878.         BEFORE you perform the CLEARSCR and RESETSCR functions! 
  1879.  
  1880.  
  1881. PFADE                                                        PFADE
  1882.  
  1883.         Summary:
  1884.         -------
  1885.  
  1886.         Pfade is the heart of GRASP. It allows you to dissolve a picture to
  1887.         the screen. You may specify one of several dissolves, the speed for
  1888.         that dissolve, and a delay after the dissolve.
  1889.  
  1890.  
  1891.         Syntax:
  1892.         ------
  1893.  
  1894.         PFADE fade number, buffer number, speed, delay
  1895.  
  1896.         where 'fade  number' is  the number  of the  fade you  want to use,
  1897.         'buffer number'  is the picture buffer number where the picture you
  1898.         want to fade has been loaded, 'speed' is the speed of the  fade and
  1899.         'delay' is  the time  to wait  after the delay. Speed can be in the
  1900.         range 0-10000. Check Appendix B for a list of fades.
  1901.  
  1902.  
  1903.         Example:
  1904.         -------
  1905.  
  1906.         PFADE 12,1,500,1000
  1907.  
  1908.         will fade the picture in buffer 1 using  fade 12  at speed  500 and
  1909.         then  wait  1000.  The  delay  works  the same as using the WAITKEY
  1910.         command. 
  1911.  
  1912.  
  1913.         Comments:
  1914.         --------
  1915.  
  1916.         The first 25 fades in GRASP are the same in all video  modes. Fades
  1917.         beyond  25  may  be  mode  specific  and must be used with caution.
  1918.         Specifying buffer 0 will  cause a  blank screen  of current drawing
  1919.         color to  be generated  and faded  to the  screen. Transparent mode
  1920.         does NOT apply to PFADE.
  1921.  
  1922.  
  1923. PFREE                                                        PFREE
  1924.  
  1925.  
  1926.         Summary:
  1927.         -------
  1928.  
  1929.         PFREE is used to free-up a picture buffer.  Sometimes, you  may run
  1930.         out of  memory and  need to  clear up some buffers you have full of
  1931.         pictures you have already used.
  1932.  
  1933.  
  1934.         Syntax:
  1935.         ------
  1936.  
  1937.         PFREE buf1, buf2, buf3...
  1938.  
  1939.         where 'buf1' and other buffers are buffers you want to free-up.
  1940.  
  1941.  
  1942.         Example:
  1943.         -------
  1944.  
  1945.         PFREE 1,2
  1946.  
  1947.         will free-up picture buffers 1 and 2.
  1948.  
  1949.  
  1950.         Comments:
  1951.         --------
  1952.  
  1953.         This is especially useful in  EGA  16  color  mode  where  space is
  1954.         critical.
  1955.  
  1956.  
  1957. PLOAD                                                        PLOAD
  1958.  
  1959.         Summary:
  1960.         -------
  1961.  
  1962.         This command is used to load a picture into a buffer. There are  16
  1963.         buffers available for pictures in GRASP. It is  advised, for memory
  1964.         reasons,  that  the  user  try  to  manage using only one buffer. A
  1965.         picture must be loaded  into a  buffer before  it can  be dissolved
  1966.         onto the screen.
  1967.  
  1968.  
  1969.         Syntax:
  1970.         ------
  1971.  
  1972.         PLOAD picture,buffer number
  1973.  
  1974.         where 'picture'  is the  name of  the picture you want to load (the
  1975.         file name extension is optional) and 'buffer number'  is the number
  1976.         of the  buffer you  want to  load in to. Valid buffer numbers are 1
  1977.         through 16. Buffer 0 is a dummy buffer  used for  solid color wipes
  1978.         and changes, and thus, no picture may be loaded into it.
  1979.  
  1980.  
  1981.         Example:
  1982.         -------
  1983.  
  1984.         PLOAD mypic,1
  1985.  
  1986.         will load the picture myfile.pic into picture buffer number 1.
  1987.  
  1988.  
  1989.         Comments:
  1990.         --------
  1991.  
  1992.  
  1993. POINT                                                        POINT
  1994.  
  1995.  
  1996.         Summary:
  1997.         -------
  1998.  
  1999.         POINT  allows  you  to  draw  a  single  pixel on the screen in the
  2000.         current drawing  color. If  a second  point is  indicated, a random
  2001.         point  is  drawn  in  the  rectangular  region  defined  by  the  4
  2002.         coordinates.
  2003.  
  2004.  
  2005.         Syntax:
  2006.         ------
  2007.  
  2008.         POINT startx, starty, <endx, endy>
  2009.  
  2010.         where 'startx' and 'starty'  is  the  location  for  the  point and
  2011.         'endx' and 'endy' define the region for randomization.
  2012.  
  2013.  
  2014.         Example:
  2015.         -------
  2016.  
  2017.         POINT 50,50
  2018.  
  2019.         will draw a point in the current drawing color at x=50, y=50.
  2020.  
  2021.         POINT 100,100,150,150
  2022.  
  2023.         will draw a random point in the region defined by 100,100,150,150.
  2024.  
  2025.  
  2026.         Comments:
  2027.         --------
  2028.          
  2029.         Transparent mode does not affect this command.
  2030.  
  2031.  
  2032. PUTUP                                                        PUTUP
  2033.  
  2034.  
  2035.         Summary:
  2036.         -------
  2037.  
  2038.         PUTUP  allows  you  to  place  a  clipping  on the screen. PUTUP is
  2039.         similar to CFADE 0, but allows  placement at  any x  and y location
  2040.         and supports transparent mode.
  2041.  
  2042.  
  2043.         Syntax:
  2044.         ------
  2045.  
  2046.         PUTUP x ,y, <buffer number>, <delay>
  2047.  
  2048.         where 'x'  and 'y'  are the location where the lower left corner of
  2049.         the clipping will be placed, 'buffer number' is the clipping buffer
  2050.         number where  the clipping  you want to put up resides and delay is
  2051.         the time to wait after the putup in hundredths of a second.
  2052.  
  2053.  
  2054.         Example:
  2055.         -------
  2056.  
  2057.         PUTUP 25,50,1,1000
  2058.  
  2059.         will put the clipping in buffer 1 up  on the  screen at  x=25, y=50
  2060.         and then wait for time 1000 (10 seconds). Remember that the x and y
  2061.         coordinates correspond to the  current video  mode. Exceeding these
  2062.         coordinates may result in an error message.
  2063.  
  2064.  
  2065.         Comments:
  2066.         --------
  2067.  
  2068.         Also see CFREE.
  2069.  
  2070.  
  2071. RESETSCR                                                   RESETSCR
  2072.  
  2073.  
  2074.         Summary:
  2075.         -------
  2076.  
  2077.         This command  is used  to reset  the virtual screen back to display
  2078.         screen size after a PAN command with a larger-than-screen picture.
  2079.  
  2080.  
  2081.         Syntax:
  2082.         ------
  2083.  
  2084.         RESETSCR
  2085.  
  2086.  
  2087.         Example:
  2088.         -------
  2089.  
  2090.         RESETSCR 
  2091.  
  2092.         will reset the virtual screen image.
  2093.  
  2094.  
  2095.         Comments:
  2096.         --------
  2097.  
  2098.         Works only with EGA modes and PAN command.
  2099.  
  2100.  
  2101. RETURN                                                       RETURN
  2102.  
  2103.  
  2104.         Summary:
  2105.         -------
  2106.  
  2107.         This command causes execution  of the  current sub-program  to halt
  2108.         and return control to the calling program.
  2109.  
  2110.  
  2111.         Syntax:
  2112.         ------
  2113.  
  2114.         RETURN
  2115.  
  2116.  
  2117.         Example:
  2118.         -------
  2119.  
  2120.         RETURN
  2121.  
  2122.         will return control to calling program.
  2123.  
  2124.  
  2125.         Comments:
  2126.         --------
  2127.  
  2128.         Also see command GOSUB.
  2129.  
  2130.  
  2131.  
  2132. SETCOLOR                                                  SETCOLOR
  2133.  
  2134.  
  2135.         Summary:
  2136.         -------
  2137.  
  2138.         Setcolor is  used to  set the color palette registers in IBM EGA 16
  2139.         color modes. On the EGA, there  are 16  possible colors,  called an
  2140.         'index', and  each of  these color  indices may  be one of 64 color
  2141.         'values'. SETCOLOR differs from CHGCOLOR in that SETCOLOR  sets all
  2142.         16  color  indices  at  once.  This  is  faster  and  is useful for
  2143.         animation effects.
  2144.  
  2145.  
  2146.         Syntax:
  2147.         ------
  2148.  
  2149.         SETCOLOR color value 1, color value 2, ... color value 16
  2150.  
  2151.         where 'color value n' lies in the range 0-63.
  2152.  
  2153.  
  2154.         Example:
  2155.         -------
  2156.  
  2157.         SETCOLOR 3,32,23,53,12,11,10,21,35,2,4,8,30,40,61,63
  2158.  
  2159.         will set the current  palette  registers  to  the  16  color values
  2160.         specified.
  2161.  
  2162.  
  2163.         Comments:
  2164.         --------
  2165.  
  2166.         Remember, this  only works  in EGA  16 color  modes and requires an
  2167.         Enhanced Color Display (ECD).
  2168.  
  2169.  
  2170. TEXT                                                          TEXT
  2171.  
  2172.  
  2173.         Summary:
  2174.         -------
  2175.  
  2176.         TEXT allows you to put-up a string of text in the font  loaded with
  2177.         FLOAD in the current drawing color.
  2178.  
  2179.  
  2180.         Syntax:
  2181.         ------
  2182.  
  2183.         TEXT x, y, string, <delay>
  2184.  
  2185.         where 'x'  and 'y'  is the location of the lower left corner of the
  2186.         first character in the string, 'string' is the string to put up and
  2187.         'delay' is  the time  to wait  after the  put-up in hundredths of a
  2188.         second.
  2189.  
  2190.  
  2191.         Example:
  2192.         -------
  2193.  
  2194.         TEXT 4,4,"This is a text string..."
  2195.  
  2196.         will put the string indicated between  the quotes  up at  x=4, y=4,
  2197.         using the current drawing color.
  2198.  
  2199.  
  2200.         Comments:
  2201.         --------
  2202.  
  2203.         The string to be put must be in double quotes.
  2204.  
  2205.  
  2206. TRAN                                                          TRAN
  2207.  
  2208.  
  2209.         Summary:
  2210.         -------
  2211.  
  2212.         TRAN allows  you to  set transparent mode on or off, and to specify
  2213.         which colors to  make  transparent.  This  is  used  for overlaying
  2214.         objects or floating objects across complex backgrounds.
  2215.  
  2216.  
  2217.         Syntax:
  2218.         ------
  2219.  
  2220.         TRAN on/off, color1, color2,...colorn
  2221.  
  2222.         where 'on/off'  specifies whether  you want transparent mode turned
  2223.         on or off and color1-colorn indicate which colors you want  to make
  2224.         transparent. Color1-colorn  may have the values 0 to maxcolor where
  2225.         maxcolor is the highest  color  number  available  in  your current
  2226.         video mode.
  2227.  
  2228.  
  2229.         Example:
  2230.         -------
  2231.  
  2232.         TRAN on 2,14
  2233.  
  2234.         will  turn  transparent  mode  on  and  make  the  colors  2 and 14
  2235.         transparent.
  2236.  
  2237.         TRAN off
  2238.  
  2239.         will turn transparent mode off.
  2240.  
  2241.  
  2242.         Comments:
  2243.         --------
  2244.  
  2245.         If you turn transparent mode on and off, the next time you  turn it
  2246.         on, you  must re-specify  which colors  you want to be transparent.
  2247.         Transparent does not work in EGA 16 color modes.
  2248.  
  2249.  
  2250. VIDEO                                                        VIDEO
  2251.  
  2252.  
  2253.         Summary:
  2254.         -------
  2255.  
  2256.         Video is used to set the video mode. Video should  be used   at the
  2257.         beginning  of  the  GRASP  text  file.  Video  modes may be changed
  2258.         during  the  demo, but caution is advised. Damage may be  done to a
  2259.         monitor if  the wrong  video mode is requested for your system. The
  2260.         default video mode is A, (see table below).
  2261.  
  2262.  
  2263.         Syntax:
  2264.         ------
  2265.  
  2266.         VIDEO vidmode
  2267.  
  2268.         where 'vidmode' is one of the following...
  2269.  
  2270.                     Maximum       Picture         Memory
  2271.         Vidmode    Resolution   # of Colors     Requirement
  2272.         --------------------------------------------------------
  2273.            0         40x25          16         2K (IBM 40 column text)
  2274.            1         80x25          16         4K (IBM 80 column text)
  2275.            2         80x25          2          4K (IBM 80 column text)
  2276.            A        320x200         4         16K (IBM CGA)
  2277.            B        320x200         16        32K (IBM PCjr/STB)
  2278.            C        640x200         2         16K (IBM CGA)
  2279.            D        640x200       16/64       64K (IBM EGA)
  2280.            E        640x350         2         32K (IBM EGA monochrome)
  2281.            F        640x350         4         64K (IBM EGA)
  2282.            G        640x350       16/64      128K (IBM EGA)
  2283.            H        720x348         2         32K (Hercules monochrome)
  2284.            I        320x200         16        32K (Plantronics/AST CGP)
  2285.            J        320x200         16        32K (IBM EGA)
  2286.  
  2287.         These modes, (with the exception of  the text  modes) correspond to
  2288.         PCPAINT video modes.
  2289.  
  2290.  
  2291.         Example:
  2292.         -------
  2293.  
  2294.         VIDEO G
  2295.  
  2296.         Will  set  up  GRASP  to  use  the  high resolution mode of the EGA
  2297.         adapter in 16 out of 64 colors.
  2298.  
  2299.  
  2300.         Comments:
  2301.         --------
  2302.  
  2303.         Memory requirement in the table above is the approximate amount  of
  2304.         memory required for the buffer to hold EACH picture you load in for
  2305.         use. Also, pay attention to the  size of  the screen  in each video
  2306.         mode. Attempting  to FADE  pictures other  that this size may yield
  2307.         unpredictable results. The exception to this is when  using the PAN
  2308.         command on an EGA.
  2309.  
  2310.  
  2311.  
  2312. WAITKEY                                                    WAITKEY
  2313.  
  2314.  
  2315.         Summary:
  2316.         -------
  2317.  
  2318.         This command  instructs the  demonstration or presentation to pause
  2319.         until a key is pressed, or  until timeout  value, if  specified. If
  2320.         timeout occurs, conditional branching is allowed.
  2321.  
  2322.  
  2323.         Syntax:
  2324.         ------
  2325.  
  2326.         WAITKEY <timeout>, <label>
  2327.  
  2328.         where 'timeout'  is the  time to wait before timeout in 100ths of a
  2329.         second and 'label' is the label to go to if timeout occurs.
  2330.  
  2331.  
  2332.         Example:
  2333.         -------
  2334.  
  2335.         WAITKEY 600,myline
  2336.  
  2337.         will wait until a key is pressed, or until delay  of 6  seconds. If
  2338.         delay of 6 seconds is reached, goto label 'myline'.
  2339.  
  2340.  
  2341.         Comments:
  2342.         --------
  2343.  
  2344.         If no  timeout is  specified, WAITKEY will wait forever until a key
  2345.         is pressed. The key that is pressed to abort the wait is  saved and
  2346.         may be tested by IFKEY.
  2347.  
  2348.  
  2349. WINDOW                                                       WINDOW
  2350.  
  2351.  
  2352.         Summary:
  2353.         -------
  2354.  
  2355.         This command  is used  to restrict  a picture  fade to a particular
  2356.         portion of the screen. The coordinates you pass are in  pixels, but
  2357.         they are rounded to the nearest byte, or usually 8 pixels.
  2358.  
  2359.  
  2360.         Syntax:
  2361.         ------
  2362.  
  2363.         WINDOW x,y,x1,y1
  2364.  
  2365.         where 'x',  'y', 'x1'  and 'y1'  are the lower left and upper right
  2366.         corner of the window to set for clipping.
  2367.  
  2368.  
  2369.         Example:
  2370.         -------
  2371.  
  2372.         WINDOW 40,40,100,160
  2373.  
  2374.         will set the fade window to  40,40,100,160. The  PFADE command will
  2375.         only fade that portion of the screen that lies in this region.
  2376.  
  2377.  
  2378.         Comments:
  2379.         --------
  2380.  
  2381.         WINDOW has no effect on the CFADE command.
  2382.  
  2383.  
  2384.  
  2385. ----------------------------------------------------------------------
  2386.  
  2387.                       Tips, Hints, Examples and Demo Programs
  2388.  
  2389.  
  2390.  
  2391.         Example Program #1 - Slide Show
  2392.         -------------------------------
  2393.  
  2394.         A simple  slideshow can  be constructed by creating a grasp command
  2395.         file as follows:
  2396.  
  2397.  
  2398.         ; Slideshow demo for GRASP
  2399.         ;
  2400.         ; This program will load and display 4 pictures, alternating
  2401.         ; between fade #1 and fade #2, waiting for a count of 500 between
  2402.         ; each fade.
  2403.         ;
  2404.          video a             ; set medium res 4 color CGA mode (this can
  2405.                              ; be whatever mode you want to use)
  2406.         ;
  2407.          load pic1           ; load pic1 into buffer 1
  2408.          fade 1              ; fade using fade number 1
  2409.          waitkey 500         ; wait for a count of 500
  2410.         ;
  2411.          load pic2           ; load pic2 into buffer 1
  2412.          fade 2              ; but use fade #2 this time.
  2413.          waitkey 500         ; etc...
  2414.         ;
  2415.          load pic3
  2416.          fade 1
  2417.          waitkey 500
  2418.         ;
  2419.          load pic4
  2420.          fade 2
  2421.          waitkey 500
  2422.         ;
  2423.          exit                ; quit the program
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.         Example Program #2 - How to animate using FLY
  2430.         ---------------------------------------------
  2431.  
  2432.         Let's say  you have  2 clippings  which are  a flock  of birds with
  2433.         wings up and wings down. To fly them across the screen, (from 0,160
  2434.         to 300,160 issue the following sequence:
  2435.  
  2436.  
  2437.          tran on 3      ; turn transparent mode on
  2438.                         ; (this assumes the background is color 3.)
  2439.         ;
  2440.          cload birds1,1                ; load in first clip
  2441.          cload birds2,2                ; load in second clip
  2442.          fly 0,160,300,160,3,4,1,2     ; fly 'em!
  2443.         ;
  2444.          tran off       ; turn off transparent mode
  2445.  
  2446.         The parameters  in the  fly command  are x1,y1,x2,y2,step(number of
  2447.         pixels between each putup),delay(time of delay between each putup),
  2448.         and list of clippings, in this case, 1 and 2.
  2449.  
  2450.  
  2451. ----------------------------------------------------------------------
  2452.  
  2453.         APPENDIX A - Command Summary
  2454.  
  2455.  
  2456.         Notes:
  2457.         -----
  2458.  
  2459.         Each  command's  arguments  (if  any) are  separated by  commas  or
  2460.         spaces, whichever is preferable.
  2461.  
  2462.         Comments  begin  at  a  semicolon  and continue for the rest of the
  2463.         line.
  2464.  
  2465.         Line  labels  are  up  to  16  characters  long  and  end   with  a
  2466.         colon,i.e.,<label>:.
  2467.  
  2468.         Subroutines can be nested up to 16 levels deep.
  2469.  
  2470.         There can be up to 16 levels of nesting in MARK,LOOP constructions.
  2471.  
  2472.         CAPITAL letters are the command name. It must be spelled correctly,
  2473.         but capitals are not required.
  2474.  
  2475.         LOWERCASE letters and numbers are parameters. You must  specify all
  2476.         required parameters, (those not enclosed in <>), or you will get an
  2477.         error message indicating too few parameters.
  2478.  
  2479.  
  2480.         Command Summary:
  2481.         ---------------
  2482.         BOX x,y,x2,y2,<width>                 - draw a box
  2483.         CFADE #,x,y,<buffer>,<speed>,<delay>  - fade a clipping to screen
  2484.         CFREE buffer,<buffer>,...             - free up clipping buffer(s)
  2485.         CHGCOLOR from,to,<from,to>,...        - EGA, change color index
  2486.         CIRCLE x,y,rx,<ry>                    - draw an ellipse
  2487.         CLEARSCR                              - clear screen
  2488.         CLOAD clipping filename,<buffer>      - load a clipping
  2489.         COLOR color1,<color2>                 - set color 1 & color 2
  2490.         EXEC program,<parameters>             - execute program from GRASP
  2491.         EXIT                                  - quit program
  2492.         FFREE                                 - free the font buffer
  2493.         FGAPS <char_gap, space_gap>           - set text gaps
  2494.         FLOAD character set filename          - load a font
  2495.         FLOAT xs,ys,xe,ye,step,delay,clp1...  - float clip across screen
  2496.         FLY xs,ys,xe,ye,step,delay,clp1...    - fly clip across screen
  2497.         FSTYLE style                          - set text style
  2498.         GOSUB label                           - execute subroutine
  2499.         GOTO label                            - goto label
  2500.         IFKEY key,label                       - if key match, goto label
  2501.         LINE x,y,x2,y2                        - draw line
  2502.         LINK textfile filename                - link to another text file
  2503.         LOOP                                  - loop to previous mark
  2504.         MARK loop count                       - mark for looping
  2505.         MODE border color,<palette>           - CGA border & palette set
  2506.         NOISE freq1,freq2,duration            - make some noise
  2507.         OFFSET x,y                            - set x and y offsets
  2508.         PALETTE buffer                        - EGA mode set palette
  2509.         PAN x0,y0,x1,y1,<buffer>              - EGA pan from x0,y0 to x1,y1
  2510.         PFADE #,<buffer>,<speed>,<delay>      - fade a picture to screen
  2511.         PFREE buffer,<buffer>,...             - free up picture buffer(s)
  2512.         PLOAD picture filename,<buffer>       - load a picture
  2513.         POINT x,y,<x2,y2>                     - draw a point
  2514.         PUTUP x,y,<buffer>,<delay>            - put a clip to screen @ x,y
  2515.         RESETSCR                              - reset screen to default
  2516.         RETURN                                - return from subroutine
  2517.         SETCOLOR c1,c2,c3...c16               - EGA mode set 16 colors
  2518.         TEXT x,y,"some text",<delay>          - put up text @ x,y
  2519.         TRAN on/off, color                    - transparent mode on/off
  2520.         VIDEO vidmode                         - set video mode
  2521.         WAITKEY <timeout>, <label>            - wait for a keypress
  2522.         WINDOW x0,y0,x1,y1                    - set clip window
  2523.  
  2524.  
  2525.  
  2526.         APPENDIX B - Fade Table
  2527.  
  2528.         There are 25 fades  in GRASP  which must  be called  by number. All
  2529.         fades  work  on  graphics  screens,  graphics  screens in a window,
  2530.         clippings  and  text  screens.  This  list  is  also  accessable by
  2531.         pressing F3 while in the GRASP editor.
  2532.  
  2533.         Fade # Description
  2534.         ------ -------------------------------------------------------
  2535.           0    Quick snap wipe
  2536.           1    Horizontal left to right wipe
  2537.           2    Horizontal right to left wipe
  2538.           3    Horizontal edge to center wipe
  2539.           4    Horizontal center to edge wipe
  2540.           5    Horizontal 1 pass filter wipe - both sides simultaneously
  2541.           6    Horizontal 2 pass filter wipe - from left, then from right
  2542.           7    Horizontal halves wipe - left to right, then right to left
  2543.           8    Horizontal halves wipe - left and right simultaneously
  2544.           9    Vertical top to bottom wipe
  2545.          10    Vertical bottom to top wipe
  2546.          11    Vertical edge to center wipe
  2547.          12    Vertical center to egde wipe
  2548.          13    Vertical filter wipe, top and bottom simultaneously
  2549.          14    Vertical halves wipe, top and bottom simultaneously
  2550.          15    Vertical halves wipe, left down, right up
  2551.          16    Vertical quarters wipe
  2552.          17    Vertical fingers wipe
  2553.          18    Vertcial fingers/filter combination wipe
  2554.          19    Slither from top to bottom
  2555.          20    Sparkle fade (random)
  2556.          21    Diagonal wipe
  2557.          22    Aperature dissolve - edge to center
  2558.          23    Aperature dissolve - center to edge
  2559.          24    Clockwise clock dissolve
  2560.          25    Double slant dissolve
  2561.  
  2562.  
  2563.  
  2564.         APPENDIX C - Error Messages
  2565.  
  2566.         The following  is a  list of  messages you  may get while executing
  2567.         GRASP and some of their causes and solutions.
  2568.  
  2569.  
  2570.         MOST COMMON ERRORS:
  2571.  
  2572.  
  2573.         I.    The most common error is not  a  grasp  program  error  but a
  2574.               system  error.  The  screen  will  clear, and you will get an
  2575.               error like
  2576.  
  2577.          External Memory allocation overflow, xxxxk requested, yyyyk free.
  2578.  
  2579.               This means that you have tried to load a picture  or clipping
  2580.               that is  too large  for the  memory you  have left. There are
  2581.               several fixes for this problem.
  2582.               1) Buy more memory. EGA 16 color demos usually take most of a
  2583.               640K machine
  2584.               2) Check your code and use PFREE, CFREE and FFREE to clean up
  2585.               memory  when  you  are  through  using  particular  pictures,
  2586.               clippings and  fonts. See  the section of the manual on these
  2587.               commands.
  2588.               3) Use the special parameter,  ',1'  on  clipping  loads that
  2589.               don't make the shifted copies. In order to be able to PUTUP a
  2590.               clipping at any single-pixel coordinate, GRASP  needs to make
  2591.               up to  8 shifted  copies of the clipping. If you are going to
  2592.               be using CFADE or putting it up at a byte  boundary, then the
  2593.               shifted copies aren't necessary. You can keep them from being
  2594.               generated by typing:
  2595.  
  2596.               CLOAD clip,1,1 ;note the extra ',1'
  2597.  
  2598.               If you do specify the extra parameter, and you try  to put up
  2599.               the  clipping  at  a  non-byte boundary, no putup will occur.
  2600.               Remember, FLY, FLOAT  and  PUTUP  can  put  clippings  at any
  2601.               coordinate. CFADE can only putup at a byte boundary.
  2602.  
  2603.               If  none  of  the  above  three work, then call the GRASP and
  2604.               PCPAINT BBS for more advice.
  2605.  
  2606.  
  2607.  
  2608.  
  2609.         II. System Errors
  2610.  
  2611.          The following is a list of  the GRASP  system errors  that you may
  2612.         encounter. These will appear on the top of the screen while running
  2613.         your demo along with a line number where  the error  occurred. When
  2614.         you press a key, you will be returned to that line in your program.
  2615.         If you get the error while running under  the runtime  version, the
  2616.         program will stop.
  2617.  
  2618.  
  2619.  
  2620.         DUPLICATE LABEL 
  2621.  
  2622.         - You have used the same label name more than once in your demo and
  2623.         GRASP is confused.
  2624.  
  2625.  
  2626.         ERROR IN LOOP COUNT
  2627.  
  2628.          - Loop count must be  a positive  number. This  error occurs  if a
  2629.         negative number was specified.
  2630.  
  2631.  
  2632.         ERROR IN NAME
  2633.  
  2634.          - You have  used an  invalid character  in a filename, or the file
  2635.         GRASP was trying to load was not found.
  2636.  
  2637.  
  2638.         ERROR IN PACKED CLIPPING
  2639.  
  2640.          - sometimes, clippings may be trashed  or  someone  tries  to load
  2641.         some other  file with a .CLP extension. If GRASP does not recognize
  2642.         a clipping as being  a  valid  clipping  file,  you  will  get this
  2643.         message.
  2644.  
  2645.  
  2646.         ERROR IN XCOORD
  2647.  
  2648.          - The Y-coordinate  lies off  the screen.  This may occur after an
  2649.         OFFSET command. If you specify 0 for the Y coordinate, but Y offset
  2650.         is set to -5, you will get this error.
  2651.  
  2652.  
  2653.         ERROR IN YCOORD
  2654.  
  2655.          - The Y-coordinate  lies off  the screen.  This may occur after an
  2656.         OFFSET command. If you specify 0 for the Y coordinate, but Y offset
  2657.         is set to -5, you will get this error.
  2658.  
  2659.  
  2660.         ERROR LOADING FONT
  2661.  
  2662.          - GRASP doesn't  recognize the  font you  are trying to load. Also
  2663.         could be too large for memory or hardware error during load.
  2664.  
  2665.  
  2666.         ERROR LOADING PICTURE
  2667.  
  2668.          - GRASP doesn't recognize the picture you are trying to load. Also
  2669.         could be hardware error during load.
  2670.  
  2671.  
  2672.         ERROR LOADING TEXT
  2673.  
  2674.          - GRASP doesn't recognize the text file you are trying to link to.
  2675.         Also could be hardware during load.
  2676.  
  2677.  
  2678.         ILLEGAL ARGUMENT(S)
  2679.  
  2680.          - One  of  the  arguments  for  the  current  command  is invalid.
  2681.         Examples are invalid video mode, etc.
  2682.  
  2683.  
  2684.         ILLEGAL BUFFER
  2685.  
  2686.          - You  have  specified  a  buffer  number that is outside of valid
  2687.         range. Buffers are 1-16 for pictures and 1-128  for clippings. Also
  2688.         may get  this when  an error occurs trying to allocate a new buffer
  2689.         during load.
  2690.  
  2691.  
  2692.         ILLEGAL COLOR
  2693.  
  2694.          - You have specified an invalid color number for this video mode.
  2695.  
  2696.  
  2697.         ILLEGAL FADE
  2698.  
  2699.          - You have specified an invalid fade number. Valid fades are 0-25.
  2700.  
  2701.  
  2702.         ILLEGAL PALETTE
  2703.  
  2704.          - You have  specified an  invalid palette  number for  CGA 4 color
  2705.         mode. Valid palettes are 0-5.
  2706.  
  2707.  
  2708.         ILLEGAL SPEED
  2709.  
  2710.          - You have specified an invalid speed for a fade. Valid speeds are
  2711.         0-10000.
  2712.  
  2713.  
  2714.         INVALID FONT STYLE
  2715.  
  2716.          - You have specified an  invalid font  style number.  Valid styles
  2717.         are 0-6.
  2718.  
  2719.  
  2720.         INVALID GAP VALUE
  2721.  
  2722.          - You have specified an invalid GAP value. Range is 0-255.
  2723.  
  2724.  
  2725.         LABEL NOT FOUND
  2726.  
  2727.          - You have  tried to  reference a  label which  was not previously
  2728.         defined.
  2729.  
  2730.  
  2731.         MEMORY ERROR
  2732.  
  2733.          - When trying to allocate the memory for your  GRASP command file,
  2734.         an error  was encountered. Usually only happens when a command file
  2735.         is too large.
  2736.  
  2737.  
  2738.         NOT ENOUGH ARGUMENTS
  2739.  
  2740.          - Certain commands require a minimum number of arguments. You need
  2741.         to specify some more.
  2742.  
  2743.  
  2744.         THIS COMMAND REQUIRES AN EGA
  2745.  
  2746.          - Just like  it says, this particular command requires an EGA card
  2747.         and EGA video mode to operate.
  2748.  
  2749.  
  2750.         TOO MANY LOOPS
  2751.  
  2752.          - You have nested your loops deeper than the maximum, which is 16,
  2753.         or you have more loop commands that mark commands.
  2754.  
  2755.  
  2756.         TOO MANY MARKS
  2757.  
  2758.          - You have nested your loops deeper than the maximum, which is 16,
  2759.         or you have more mark commands than loop commands.
  2760.  
  2761.  
  2762.         UNKNOWN COMMAND
  2763.  
  2764.          - GRASP found something that was not  a comment,  not a  label and
  2765.         couldn't recognize as a valid command. Check your spelling.
  2766.  
  2767.  
  2768.  
  2769.         APPENDIX D - Picture Swap Line
  2770.  
  2771.  
  2772.         There is  a public  domain electronic bulletin board which operates
  2773.         24 hours a day with the sole purpose of providing a method by which
  2774.         users of PCPAINT and GRASP may exchange pictures, clippings, fonts,
  2775.         effects and ideas. This help eliminate the extra  cost of providing
  2776.         artwork for  many of  the GRASP  demos you  may want to create. The
  2777.         most current version of GRASP will be avaliable this system.
  2778.  
  2779.         All uploads and downloads are free  and may  be used  by anyone. We
  2780.         encourage you  to contribute  any artwork you feel could be used by
  2781.         someone else. Of  course  there  will  be  proprietary  artwork you
  2782.         either pay  to have  developed, or  need to  keep confidential. But
  2783.         your discards may be another's joy...
  2784.  
  2785.         The BBS is located in Costa Mesa, California, and the number is
  2786.  
  2787.                            ***    (714) 545-8100    ***
  2788.  
  2789.         You will be limited to 1 hour of use per  day. We  suggest that you
  2790.         use 1200  or 2400 baud modems set at 8 bits, 1 stop bit, no parity.
  2791.         You will be transferring binary files so the 8 bit mode is  a must.
  2792.         There are  several utility programs you will want to download first
  2793.         which allow you to squeeze and unsqueeze the pic files so that they
  2794.         will not  take as  much time  to upload and download. You will find
  2795.         them in the UTILITY file area.
  2796.  
  2797.  
  2798.         Thanks in advance for your support and contributions to the board.
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.         APPENDIX E - GRASP Order Form
  2805.  
  2806.         GRASP is distributed in the USEware format. If you are going to USE
  2807.         it, please  check the  appropriate box below and enclose a check or
  2808.         purchase order. If you find the program unUSEable, please drop us a
  2809.         line telling  us why. If you pay for the program by sending in this
  2810.         registration form with a check or money order, you will be added to
  2811.         our  mailing  list  and  be  kept  notified of new releases and new
  2812.         utilities.
  2813.  
  2814.         ------------------------------------------------------------------
  2815.         Single-User Order Form
  2816.         ======================
  2817.         If you are going to pay for less than 50 copies, use this form. The
  2818.         single  user  price  is  $50.00. California residents please add 6%
  2819.         sales tax. You must pay for EACH copy you plan to use.
  2820.  
  2821.         Full Name:__________________________  ___ Copies @ $50.00=_________
  2822.  
  2823.         Address  :__________________________      6% Sales Tax   =_________
  2824.  
  2825.                  :__________________________      Total Enclosed =_________
  2826.  
  2827.         City, St.:_________________    _____  Zip:_________________
  2828.  
  2829.         ------------------------------------------------------------------
  2830.         Corporate Site License Order Form
  2831.         =================================
  2832.         If you are going to be using in excess of 50 copies of GRASP within
  2833.         your company at one site, (5 mile radius from licensing party), you
  2834.         need only pay for the  first  50  copies.  You  may  then  make and
  2835.         distribute to  your employees  an unlimited number of copies of the
  2836.         software and manual. We have 45 day billing  if you  include a P.O.
  2837.         number instead of a check or money order.
  2838.  
  2839.         Primary Corporate Contact for updates, etc.:
  2840.  
  2841.         Full Name :_________________________  50 Copies @ $50.00 = $2500.00
  2842.  
  2843.         Address   :_________________________        6% Sales Tax =_________
  2844.  
  2845.                   :_________________________      Total Enclosed =_________
  2846.  
  2847.         Department:_________________________   P.O. Number:________________
  2848.  
  2849.         City, St. :_________________    _____     Zip:_________________
  2850.  
  2851.         Authorized Signature:______________________________  Date:_________
  2852.  
  2853.         ------------------------------------------------------------------
  2854.  
  2855.  
  2856. ++---------------------------------------------------------------------
  2857.  
  2858.  
  2859. Things fixed or changed since 3.1a
  2860. ----------------------------------
  2861.  
  2862.   1) PCX support should be completed. Included 256 color. Files should be
  2863.      identical to PCX output.
  2864.  
  2865.   2) PFADE should work like PFADE 0 if a window is used.
  2866.  
  2867.   3) Default mode (text) should clear screen in GRASPRT.
  2868.  
  2869.  *4) DLOAD, DFREE and PUTDFF should be added to GRASP.
  2870.  
  2871.      DLOAD defaults to buffer 1 like CLOAD and PLOAD and FLOAD    
  2872.  
  2873.      PUTDFF BUFNUM DELAY BEGIN END XPOS YPOS
  2874.  
  2875.      BUFNUM defaults to 1
  2876.      DELAY defaults to 0
  2877.      BEGIN defaults to 0
  2878.      END defaults to BEGIN is BEGIN is given, else defaults to last frame
  2879.      XPOS defaults to 0
  2880.      YPOS defaults to 0
  2881.  
  2882.  *5) STB VGA/EM card isn't being reset to text mode after quit of Pictor.
  2883.  
  2884.  *6) Pictor needs to allow CUT, COPY, PASTE, INVERT while in Change Colors box.
  2885.      This applies to the colors that lie between left and right button color.
  2886.  
  2887.  *7) Bug in MOVE command in GRASP where it doesn't hide the mouse cursor.
  2888.  
  2889.  *8) 80386 bug in moving large regions in Pictor, GRASP. 
  2890.  
  2891.   9) For PFADEs and CFADEs (ALL of them!) the lower left corner of the buffer
  2892.      should align with the lower left corner of the window unless altered
  2893.      with the position command. This means we should have some sort of
  2894.      position for CFADE. Perhaps OFFSET?
  2895.  
  2896. *10) ERRORLEVEL is asigned to a key after an EXEC so IFKEY can test for it.
  2897.  
  2898. *11) SPREAD 1,2 used to set palette 1 then spread to palette 2. Now, it works
  2899.      properly where it just figures the differences and does the spread. This
  2900.      allows very nice complicated operations previously impossible.
  2901.  
  2902.  
  2903.  
  2904.  
  2905. ++---------------------------------------------------------------------
  2906.  
  2907. The formats of GRASP animation files.
  2908. By George Phillips <phillips@cs.ubc.ca>
  2909. Distribute this freely, but give credit where credit is due, eh?
  2910. Version: Jan. 19,1991
  2911.  
  2912. GRASP is an animation system particular to the IBM PC world.  It consists
  2913. of a program to create animations and a run-time environment for
  2914. displaying them.  The most common form these animations take is ".GL"
  2915. archives which may be displayed on an IBM-PC with a program called
  2916. GRASPRT.EXE.  This document describes what I have been able to
  2917. decipher about the format of ".GL" archives and the files contained
  2918. within.  It should be useful to those attempting to write ".GL"
  2919. animation players on other platforms.
  2920.  
  2921. A ".GL" file is simply an archive file which contains images, fonts
  2922. and a command file which tells GRASPRT what to do.  These various
  2923. files have standard extensions to denote their contents:
  2924.  
  2925. .txt - A command file; usually there is only one of these per archive.
  2926. .pic - An image.
  2927. .clp - An image but without a colour map.
  2928. .set or .fnt - A font containing character glyphs.
  2929.  
  2930. It should be noted that the GL archive is of no particular importance;
  2931. all the archived files could exist as ordinary files and the animation
  2932. should still work.  Any GL player should be able to operate both from
  2933. an archive or from ordinary files.
  2934.  
  2935.  
  2936. File Formats
  2937.  
  2938. Most of the data in GL files can be adequately described as a stream
  2939. of bytes which is practically universally understood.  Some fields
  2940. contain 2-byte and 4-byte integers.  I'll refer to these as "words"
  2941. and "long words" and they are all stored in little-endian format.
  2942. So if we have 4 consecutive bytes, b1, b2, b3 and b4, the word
  2943. at b1 is (b1 + b2 * 256) and the long word at b1 is
  2944. (b1 + b2 * 256 + b3 * 256 * 256 + b4 * 256 * 256 * 256).
  2945.  
  2946. Since this information was gathered by example, the purpose of some
  2947. header fields and commands may not be known.  I've marked unknown
  2948. fields with question marks and have tried to put question marks and
  2949. other warnings about descriptions which are guesses.
  2950.  
  2951.  
  2952. GL Archives (.gl)
  2953.  
  2954. A GL archive begins with a directory listing the files in the archive
  2955. which is followed by the data for each file.
  2956.  
  2957. +-- Directory Header
  2958. | dir length    (word)        number of bytes in the directory header
  2959. | +-- File Entry (17 bytes per, (dir length) / 17 of them)
  2960. | | offset    (long word)    Position of file data as an offset from
  2961. | |                the beginning of the archive
  2962. | | name    (13 bytes)    File name, null padded.
  2963. | +--
  2964. +--- File data area
  2965. | +-- File Data
  2966. | | length    (long word)    Size of the file
  2967. | | data    (bytes)        the file's data (surprise!)
  2968. | +--
  2969. +---
  2970.  
  2971. Font Files (.fnt or .set)
  2972.  
  2973. These are very simple; first a short header describing the size of the
  2974. characters in the font and what byte values correspond to each glyph
  2975. followed by the glyph data.
  2976.  
  2977. +-- Font Header
  2978. | length    (word)        length of the entire font file
  2979. | size        (byte)        number of glyphs in the font file
  2980. | first        (byte)        byte value represented by the first glyph
  2981. | width        (byte)        width of each glyph in pixels
  2982. | height    (byte)        height of each glyph in pixels
  2983. | glyphsize    (byte)        number of bytes to encode each glyph
  2984. +-- Glyph Data
  2985. | glyph first
  2986. | glyph first + 1
  2987. | ...
  2988. | glyph first + size - 2
  2989. | glyph first + size - 1
  2990. +--
  2991.  
  2992. Each glyph is stored almost exactly as you would expect a raw PBM file to
  2993. contain it except that a '0' bit means black and a '1' bit means white.
  2994. In other words, row major order, each line padded to end on a byte
  2995. boundary, most significant bit is leftmost.
  2996.  
  2997.  
  2998. Image Formats (.pic and .clp)
  2999.  
  3000. These consist of a header containing the usual image information followed
  3001. by blocked, run-length encoded image data.
  3002.  
  3003. +-- Image Header (17 or 19 bytes)
  3004. | magic?    (byte)        magic number?  Always is 0x34 or 0x12
  3005. | width        (word)        width of image in pixels
  3006. | height    (word)        heigh of image in pixels
  3007. | ????        (4 bytes)    unknown
  3008. | bpp        (byte)        bits per pixel (only seen 1 or 8)
  3009. | type        (byte)        image type, either 'L' or 'C'
  3010. | flags        (byte)        if (flags & 4) then image has colourmap
  3011. | ?        (byte)        unknown
  3012. | extend    (byte)        extended header byte (if != 0, header
  3013. |                has 2 more bytes) 1/2?
  3014. | ?        (byte)        unknown
  3015. | ??        (2 bytes)    header extension if extend != 0
  3016. +-- Colour Map ((1 << bpp) * 3 bytes, only if flags & 4 == 4)
  3017. | +-- Colour Map entries (as many as indicated by bpp)
  3018. | | R        (byte)        red intensity, 0 - 63   \
  3019. | | G        (byte)        green intensity, 0 - 63  + entry 0
  3020. | | B        (byte)        blue intensity, 0 - 63  /
  3021. | +--
  3022. | ...
  3023. +-- Image Data
  3024. | blocks    (word)        number of blocks of data
  3025. | +-- Data Block (blocks of them)
  3026. | | length    (word)        length of data block, including header
  3027. | | bufsize    (word)        buffer size needed to hold all the
  3028. | |                uncompressed data in this block
  3029. | | esc        (byte)        the escape code in this block
  3030. | | data    (length - 5 byte)    run-length encoded data
  3031. | +--
  3032. +--
  3033.  
  3034. The run-length encoding is byte oriented and follows these rules:
  3035.  
  3036. - characters other than "esc" (see data block header) are literal
  3037. - esc n c means repeat c n times (1 <= n <= 255)
  3038. - esc 0 len(word) c means repeat c len times
  3039.  
  3040. If bpp=1, then the resulting data stream is interpreted as it is
  3041. with font glyphs (i.e., msb is left, pad to bytes, row first, etc).
  3042. If bpp=8, then each byte in the data stream is an index into the
  3043. colour map.  If no colour map is available, the map to use can
  3044. only be discovered by running through the command file.
  3045.  
  3046. I've only seen images with bpp=1 and bpp=8 and they it always works
  3047. out that either bpp=1 and type=C or bpp=8 and type=L.  The type=C
  3048. corresponds to CGA graphics which are mostly monochrome and 640 x 200
  3049. (so the aspect ratio is funny).  Type=L is colour graphics, prob. VGA
  3050. and usually 320 x 200.  Notice that the colour maps have only 6
  3051. bits, the same as VGA's digital to analog converters.  ".pic" files
  3052. always have colour maps, ".clp" files never do.  It seems that
  3053. you can be lazy with your run-length decoding code; I've never seen
  3054. a full sequence appear across a data-block boundary (encoders should
  3055. probably not let that happen).  The amount of uncompressed data
  3056. in a block never seems to exceed 8192 bytes.
  3057.  
  3058. Much of the header information is mysterious.  Note that the header
  3059. extension field is a guess and that there are other consistent
  3060. possibilities (e.g., the extension field is a length byte or even
  3061. part of a length word).  Only type=C images seem to have the
  3062. extension.  Maybe the extra information is supposed to be used
  3063. in video mode operating system calls on the PC?
  3064.  
  3065. What made this part easier was the existence of a PC-based program which
  3066. converts ".pic" files into GIF files.  Its called "cvt2gif" and can
  3067. be found on wuarchive.wustl.edu:/mirrors/msdos/gif/cvt2gif.zip.  Those
  3068. wishing to enhance the format descriptions would do well to get a
  3069. copy.  I did notice that bpp=1 images are not necessarily black and white
  3070. but could be black and some other colour as selected from the CGA
  3071. pallette.  I doubt the distinction will make much difference to the
  3072. animation, but if you really want to do it right...
  3073.  
  3074.  
  3075. Command File (.txt)
  3076.  
  3077. The command file looks like a typical script file with the lines delimited
  3078. by carriage returns, line feeds or both.  Any text following ';' on a line
  3079. is a comment.  Text followed by a colon is used to indicate a label
  3080. (much like most assemblers).  Commands consist of a keyword followed by a
  3081. list of comma separated arguments.  The input is case-insensitive except
  3082. for arguments containing text to display (which are in double quotes).
  3083.  
  3084. The basis of the command language seems to be what I call picture and
  3085. clip registers, of which there are 16 of each.  A few commands will
  3086. load a picture (or clip) from a file into a register.  Other commands
  3087. then reference the register numbers to display the pictures or get
  3088. colour maps from them.  It seems that the colour map from a picture
  3089. (.pic) is installed into the hardware and this is where the
  3090. colour maps for the clips (.clp) come from.  I assume that I am missing
  3091. a lot of commands, but most notably I believe there should be
  3092. more primitive drawing commands.
  3093.  
  3094. Many of the commands seem to have a delay argument associated with
  3095. them.  This seems reasonable as control over time in an animation
  3096. is important.  I may have been over-zealous in looking for delays.
  3097. The actual time units of the delays is unknown.  They are typically
  3098. numbers < 100, so milliseconds are a likely candidate.  Hundredths
  3099. of a second are possible as well.
  3100.  
  3101. Here is a list of commands.  Optional arguments are enclosed in [].
  3102. Ranges are possible in arguments (I've only seem them in fly) and
  3103. take the form "n,-,m", (e.g., fly 0,0,10,10,1,1,1,-,16).
  3104.  
  3105. * box x1,y1,x2,y2,colour?
  3106. Draw a box with corners (x1, y1) and (x2, y2) in the colour given by
  3107. the colourmap entry number.
  3108.  
  3109. * cfade x,y,delay,img,[,?,?]
  3110. Display a clip image img at (x, y) and wait for delay time units before
  3111. proceeding.
  3112.  
  3113. * cfree n
  3114. Free up any memory associated with clip register n.
  3115.  
  3116. * clearscr
  3117. Clear the display (to the currently selected colour or black?).
  3118.  
  3119. * cload name,num[,?]
  3120. Load a clip image "name" into clip register num.  If name does not
  3121. have a .clp extension, it will be automatically appended.
  3122.  
  3123. * color n
  3124. Set the current colour to n.  This at least seems to affect the
  3125. text displaying commands.
  3126.  
  3127. * exit
  3128. Terminate the command file.
  3129.  
  3130. * fload name
  3131. Load the named font which becomes the font to be used when displaying
  3132. text.  ".fnt" is appended to name if necessary.
  3133.  
  3134. * float x1,y1,x2,y2,step?,delay?,num
  3135. Move the clip image (num) by displaying it at (x1,y1) and erasing it
  3136. and displaying it every step pixels until (x2,y2).  Delay delay time
  3137. units in between steps.  Or maybe something completely different,
  3138. but the x1,y1,x2,y2 and num arguments are probably coordinates and
  3139. a clip number.
  3140.  
  3141. * fly x1,y1,x2,y2,step?,delay?,clip list
  3142. Successively display the clip images from (x1,y1) to (x2,y2) with delay
  3143. time units in-between.  The clip list is just a bunch of clip numbers
  3144. separated by commas (i.e., fly is varags).  A range is likely to
  3145. appear in the clip list.  Often (x1,y1) == (x2,y2).
  3146.  
  3147. * fstyle ?[,?]
  3148. Presumably set up some parameters on how a font is displayed.
  3149.  
  3150. * goto label
  3151. Force flow of control to the given label.
  3152.  
  3153. * loop
  3154. Denotes the end of a mark loop.  Continues the loop at the most recent
  3155. mark if the loop hasn't finished.  
  3156.  
  3157. * mark n
  3158. This pairs with the loop command and begins a for loop from 1 to n.
  3159. One assumes that the interaction of mark, loop and goto is the same
  3160. as for, next and goto in BASIC.  That is, loops are dynamically
  3161. scoped and you can jump in and out of them.  Mark simply pushes
  3162. a loop start onto the stack and loop examines whatever is on
  3163. the top of the loop stack.
  3164.  
  3165. * mode ?
  3166. Modify the current video mode in some way.  I haven't seen this often.
  3167.  
  3168. * note freq,delay?,duration
  3169.  
  3170. Play a musical note of the given frequency and duration and delay for
  3171. delay time units afterward.
  3172.  
  3173. * pallette n
  3174. Make the colour map from picture register n be the one to use.  This probably
  3175. installs it into the hardware so that when a clip is loaded there is
  3176. no colour map to change.
  3177.  
  3178. * pfade effect,pict[,delay?[,?,?]]
  3179. Display the picture numbered pict on the screen.  The effect number
  3180. indicates what sort of special effect is used to display it.  What
  3181. the numbers mean I have no idea, but I know some of the effects.
  3182. Each pixel loaded randomly, every even line then every odd line
  3183. and so on.  The delay parameter seems to make sense, but not always.
  3184. The extra parameters could be those needed for some effects.  Often
  3185. they are large numbers.
  3186.  
  3187. * pfree n
  3188. Free up any memory associated with picture register n.
  3189.  
  3190. * pload name,n
  3191. Load picture "name" into picture register n.  ".pic" is appended to
  3192. name if necessary.
  3193.  
  3194. * putup x,y,n
  3195. Display clip register n at (x,y).
  3196.  
  3197. * set retrace [on|off]
  3198. Set is probably a general internal control variable changing command.
  3199. What retrace is I have no idea, but it was set off then on around
  3200. a fly statement.
  3201.  
  3202. * spread ?,?
  3203. Who knows, but the numbers used are probably picture register numbers.
  3204. Maybe some kind of colourmap changing?
  3205.  
  3206. * text x,y,"text",[delay?]
  3207. Display the given text (enclosed in double quotes) at (x,y).  The
  3208. extra parameter is probably a display, but it could be the display
  3209. colour or the background colour.  Probably the display colour is
  3210. that given by the color statement.
  3211.  
  3212. * tran [on 0|off]
  3213. No idea.  Was used around some cload and float statements.
  3214.  
  3215. * video mode
  3216. Set the display mode to 'C' or 'L' (remember the image format types?).
  3217. Usually the first statement in a command file.  C almost certainly
  3218. refers to CGA which is 640 x 200 monochrome and L almost certainly
  3219. to VGA which (in their case) is 320 x 200 x 256.
  3220.  
  3221. * waitkey [[delay[,label]]
  3222. Wait up to delay units for the user to press a key (or forever if no
  3223. delay time is given).  If the user presses a key and the label
  3224. argument is present, transfer control to that label.
  3225.  
  3226. * window x1,y1,x2,y2,?
  3227. Some kind of display control.  Probably a clipping window with appropriate
  3228. coordinate translation (i.e., (0,0) becomes (x1,y1)).
  3229.  
  3230.  
  3231.  
  3232. This document was created by looking hard at a number of GL files,
  3233. using cvt2gif to help decipher the image file format and looking
  3234. at 1 or 2 animations on an RS-6000 running a PC emulator and using
  3235. grasprt.  cvt2gif was very useful; grasprt under the PC emulator
  3236. was painfully slow at times and didn't help my understanding
  3237. much.  I've never even gotten close to a copy of the program for
  3238. creating and editing GL files.
  3239.  
  3240. If you find out more about GL files, send me the changes so I can
  3241. extend this document.  Feel free to include this as supplementary 
  3242. documentation if you write a GL player.  Finally, here are some
  3243. projects which could help find out more about GL files:
  3244.  
  3245. - Get cvt2gif and feed it small variations on .pic files to decipher
  3246. the meaning of the missing header fields.  I may do this.
  3247.  
  3248. - Alter control files on some animations and see what effects they
  3249. have.  Something easy would be to change the effect number on
  3250. pfade statements (if that's what it is).  I don't have the hardware
  3251. to do this.
  3252.  
  3253. - Look at the GRASP animation package and intuit what the commands
  3254. mean by what control you have over generating animations.  This is
  3255. probably the easiest way to get information.  I don't have GRASP,
  3256. I don't know where to get it and I don't has a PC good enough to
  3257. run it on.
  3258.  
  3259.  
  3260. ++---------------------------------------------------------------------
  3261.  
  3262.  
  3263.                    PCPAINT/Pictor Page Format Description
  3264.  
  3265.                           Format by John Bridges.
  3266.  
  3267.                    Document by Microtex Industries, Inc.
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273. Revision Date: 2/9/88
  3274.  
  3275.  
  3276.  
  3277. Global Notes:
  3278. ------------
  3279.  
  3280. PCPAINT 1.0 - Revision 1.0 was developed for Mosue Systems in 1984 supported
  3281. only BSAVE files in CGA 4 color mode. In the space between the scan buffers
  3282. was a string that read PCPAINT 1.0 followed by 2 bytes which were the pallete
  3283. and border information for that picture.
  3284.  
  3285. PCPAINT 1.5 - Revision 1.5 was the same as 1.0 except that it contained larger
  3286. than screen images and also had a primative packing format. This was sold for
  3287. so short a time that it won't be covered here.
  3288.  
  3289. PCPAINT 2.0 thru Pictor 3.1 - This document describes these formats. The file
  3290. description is identical for all revisions in this range. However, in
  3291. PCPAINT 2.0, the bit-planes were packed together so that the pictures
  3292. resembled a PCjr picture, or 4 bits per pixel, 1 bit plane. Starting with
  3293. Pictor 3.0, the files were saved with the bitplanes separated. This takes a
  3294. little more memory in some cases, but the speed in loading and saving was a
  3295. desireable consideration.
  3296.  
  3297. NOTE TO PROGRAMMERS: A good PCPAINT/Pictor file decoder will use the variables
  3298.                      in the header to decode the image and thus be compatible
  3299.                      with all formats since the October, 1985 release of
  3300.                      PCPAINT 2.0.
  3301.  
  3302. Also please note that PCPAINT/Pictor are stored from the bottom up. This is
  3303. opposite that of most of the screen adapters it supports. This really causes
  3304. no problem, but be aware that you should use a Y table to look up scan lines.
  3305. In all PCPAINT/Pictor pictures, the scan lines are continuous. If a picture 
  3306. is to be displayed on a particular adapter, the programmer is responsible for
  3307. using a y-table to properly interleave the lines if necessary.
  3308.  
  3309. Also note that Pictor was designed for speed, so no inter-mode loading is
  3310. possible. If you are writing applications that create Pictor images that you
  3311. want to load into Pictor, you must remain mode dependent. 
  3312.  
  3313. Header - A full description of the file header information.
  3314.  
  3315. offset    type    name    description
  3316. -------    -------    -------    ----------------------------------------------------- 
  3317.   0    word    marker    marker that is always 01234h
  3318.  
  3319.   2    word    xsize    x size of page in pixels 
  3320.  
  3321.   4    word    ysize    y size of page in pixels
  3322.  
  3323.   6    word    xoff    x offset into page where lower left hand corner of
  3324.             viewport is located (default of 0 is ok)
  3325.  
  3326.   8    word    yoff    y offset into page where lower left hand corner of
  3327.             viewport is located (default of 0 is ok)
  3328.  
  3329.  10    byte    bitsinf    bits 0-3 is the number of bits per pixel per bit
  3330.             plane and bits 4-7 is the number of bit planes (so
  3331.             4 color cga mode would be 02h and 16 color ega would
  3332.             be 31h and plantronics 16 color would be 12h)
  3333.  
  3334.  11    byte    emark    marker that is always a 0ffh
  3335.  
  3336.  12    byte    evideo    single uppercase letter indicating which video mode
  3337.             this picture was created in, can default to 0.
  3338.  
  3339.             0 - 40 col text
  3340.             1 - 80 col text
  3341.             2 - mono text
  3342.             3 - 43 line text
  3343.  
  3344.             A=320x200x4 cga
  3345.             B=320x200x16 pcjr, stbplus, tandy 1000
  3346.             C=640x200x2 cga
  3347.             D=640x200x16 ega
  3348.             E=640x350x2 ega
  3349.             F=640x350x4 ega
  3350.             G=640x350x16 ega
  3351.             H=720x348x2 hercules
  3352.             I=320x200x16 plantronics
  3353.             J=320x200x16 ega
  3354.             K=640x400x2 AT&T or Toshiba 3100
  3355.             L=320x200x256 vga
  3356.             M=640x480x16 ega plus(video 7, tseng, paradise), vga
  3357.             N=720x348x16 Hercules InColor
  3358.             O=640x480x2 vga
  3359.  
  3360.  13    word    edesc    extra information descriptor defines what is in
  3361.             the extra information that follows this header,
  3362.             0=nothing
  3363.             1=pallet (single byte) border (single byte)[CGA]
  3364.             2=pcjr or non ECD 16 color registers (0-15), 1 byte each
  3365.             3=EGA with ECD 16 color registers (0-63) 1 byte each
  3366.             4=VGA 256 color info - 256 colors, 1 byte each rgb gun.
  3367.  
  3368.  15    word    esize    size of extra information in bytes
  3369.  
  3370.  17    byte    edata[]    the actual extra data the size which is defined
  3371.             by esize (at offset 15).
  3372.  17+
  3373.  esize    word    numblks    the number of packed blocks in this file. if this is
  3374.             a zero, then data is unpacked. 
  3375.  
  3376.  
  3377. Structures - These C structures describe the header information.
  3378.  
  3379. If the file is packed then what follows is a multi block packed file,
  3380. otherwise (if the file is not packed, numblks=0) the actual data follows.
  3381.  
  3382. Bit planes follow each other in the file and when packed each bit plane
  3383. must start in a new packed block.
  3384.  
  3385.  
  3386. Packed Block Description
  3387.  
  3388.  
  3389. Packed block header
  3390.  
  3391. 0PBSIZE    dw        ;Packed block size. The size of this block
  3392. BSIZE    dw        ;Unpacked block size
  3393. MBYTE    db        ;Unique marker byte. This is a byte that does not
  3394.             ; exist in the current unpacked block. If no unique
  3395.             ; byte exists, then pick one that is used rarely
  3396.             ; to avoid too much redundancy.
  3397.  
  3398. Packed block data - variable size depending on whether 16 bit run is needed.
  3399.  
  3400. MARKER    db        ;mark a run (this is where MBYTE goes) 
  3401. LENGTH    db        ;length of run. if 0, then look at BIGLEN
  3402.  
  3403. BIGLEN    dw        ;16 bit run count (only exists if LENGTH==0)
  3404. DATA    db        ;byte to fill run with
  3405.  
  3406.  
  3407. Example 1 - a 320x200, 4 color, packed page file, of a white screen. 
  3408.  
  3409.     dw    0x1234        ;marker
  3410.     dw    320        ;x size
  3411.     dw    200        ;y size
  3412.     dw    0        ;x offset
  3413.     dw    0        ;y offset
  3414.     db    02h        ;2 bits per pixel and 1 bit plane
  3415.  
  3416.     db    0xff        ;extra info flag
  3417.     db    'A'        ;vidmode
  3418.     dw    1        ;extra area descriptor (pal and bord)
  3419.     dw    2        ;bytes in extra area
  3420.     db    2,0        ;pallet and border (extra information)
  3421.  
  3422.     dw    2        ;number of packed blocks
  3423.  
  3424. ;first block
  3425.     dw    5+5        ;packed block size
  3426.     dw    8192        ;unpacked block size
  3427.     db    0        ;marker byte
  3428.     db    0        ;mark a run
  3429.     db    0        ;a 16 bit run count follows
  3430.     dw    8192        ;16 bit run count
  3431.     db    0xff        ;byte to fill run with
  3432. ;second block
  3433.     dw    5+5        ;packed block size
  3434.     dw    7808        ;unpacked block size
  3435.     db    0        ;marker byte
  3436.     db    0        ;mark a run
  3437.     db    0        ;a 16 bit run count follows
  3438.     dw    7808        ;16 bit run count
  3439.     db    0xff        ;byte to fill run with
  3440.  
  3441.  
  3442.  
  3443.  
  3444. Example 2 - a 640x350, 16 color, packed page file, of a red screen (color 4).
  3445.  
  3446.     dw    0x1234        ;marker
  3447.     dw    640        ;x size
  3448.     dw    350        ;y size
  3449.     dw    0        ;x offset
  3450.     dw    0        ;y offset
  3451.     db    31h        ;bits per pixel and 1 bit plane
  3452.  
  3453.     db    0xff        ;new extra info flag
  3454.     db    'G'        ;vidmode
  3455.     dw    3        ;extra area descriptor (pal and bord)
  3456.     dw    16        ;bytes in extra area
  3457.     db    0,1,2,3,4,5,14h,7
  3458.     db    38h,39h,3ah,3bh,3ch,3dh,3eh,3fh
  3459.  
  3460.     dw    16        ;number of packed blocks
  3461. ;block 1 of first bit plane
  3462.     dw    5+5        ;packed block size
  3463.     dw    8192        ;unpacked block size
  3464.     db    0        ;marker byte
  3465.     db    0        ;mark a run
  3466.     db    0        ;a 16 bit run count follows
  3467.     dw    8192        ;16 bit run count
  3468.     db    0        ;byte to fill run with
  3469. ;block 2 of first bit plane
  3470.     dw    5+5        ;packed block size
  3471.     dw    8192        ;unpacked block size
  3472.     db    0        ;marker byte
  3473.     db    0        ;mark a run
  3474.     db    0        ;a 16 bit run count follows
  3475.     dw    8192        ;16 bit run count
  3476.     db    0        ;byte to fill run with
  3477. ;block 3 of first bit plane
  3478.     dw    5+5        ;packed block size
  3479.     dw    8192        ;unpacked block size
  3480.     db    0        ;marker byte
  3481.     db    0        ;mark a run
  3482.     db    0        ;a 16 bit run count follows
  3483.     dw    8192        ;16 bit run count
  3484.     db    0        ;byte to fill run with
  3485. ;block 4 of first bit plane
  3486.     dw    5+5        ;packed block size
  3487.     dw    3424        ;unpacked block size
  3488.     db    0        ;marker byte
  3489.     db    0        ;mark a run
  3490.     db    0        ;a 16 bit run count follows
  3491.     dw    3424        ;16 bit run count
  3492.     db    0        ;byte to fill run with
  3493. ;block 1 of second bit plane
  3494.     dw    5+5        ;packed block size
  3495.     dw    8192        ;unpacked block size
  3496.     db    0        ;marker byte
  3497.     db    0        ;mark a run
  3498.     db    0        ;a 16 bit run count follows
  3499.     dw    8192        ;16 bit run count
  3500.     db    0        ;byte to fill run with
  3501. ;block 2 of second bit plane
  3502.     dw    5+5        ;packed block size
  3503.     dw    8192        ;unpacked block size
  3504.     db    0        ;marker byte
  3505.     db    0        ;mark a run
  3506.     db    0        ;a 16 bit run count follows
  3507.     dw    8192        ;16 bit run count
  3508.     db    0        ;byte to fill run with
  3509. ;block 3 of second bit plane
  3510.     dw    5+5        ;packed block size
  3511.     dw    8192        ;unpacked block size
  3512.     db    0        ;marker byte
  3513.     db    0        ;mark a run
  3514.     db    0        ;a 16 bit run count follows
  3515.     dw    8192        ;16 bit run count
  3516.     db    0        ;byte to fill run with
  3517. ;block 4 of second bit plane
  3518.     dw    5+5        ;packed block size
  3519.     dw    3424        ;unpacked block size
  3520.     db    0        ;marker byte
  3521.     db    0        ;mark a run
  3522.     db    0        ;a 16 bit run count follows
  3523.     dw    3424        ;16 bit run count
  3524.     db    0        ;byte to fill run with
  3525. ;block 1 of third bit plane
  3526.     dw    5+5        ;packed block size
  3527.     dw    8192        ;unpacked block size
  3528.     db    0        ;marker byte
  3529.     db    0        ;mark a run
  3530.     db    0        ;a 16 bit run count follows
  3531.     dw    8192        ;16 bit run count
  3532.     db    0xff        ;byte to fill run with
  3533. ;block 2 of third bit plane
  3534.     dw    5+5        ;packed block size
  3535.     dw    8192        ;unpacked block size
  3536.     db    0        ;marker byte
  3537.     db    0        ;mark a run
  3538.     db    0        ;a 16 bit run count follows
  3539.     dw    8192        ;16 bit run count
  3540.     db    0xff        ;byte to fill run with
  3541. ;block 3 of third bit plane
  3542.     dw    5+5        ;packed block size
  3543.     dw    8192        ;unpacked block size
  3544.     db    0        ;marker byte
  3545.     db    0        ;mark a run
  3546.     db    0        ;a 16 bit run count follows
  3547.     dw    8192        ;16 bit run count
  3548.     db    0xff        ;byte to fill run with
  3549. ;block 4 of third bit plane
  3550.     dw    5+5        ;packed block size
  3551.     dw    3424        ;unpacked block size
  3552.     db    0        ;marker byte
  3553.     db    0        ;mark a run
  3554.     db    0        ;a 16 bit run count follows
  3555.     dw    3424        ;16 bit run count
  3556.     db    0xff        ;byte to fill run with
  3557. ;block 1 of fourth bit plane
  3558.     dw    5+5        ;packed block size
  3559.     dw    8192        ;unpacked block size
  3560.     db    0        ;marker byte
  3561.     db    0        ;mark a run
  3562.     db    0        ;a 16 bit run count follows
  3563.     dw    8192        ;16 bit run count
  3564.     db    0        ;byte to fill run with
  3565. ;block 2 of fourth bit plane
  3566.     dw    5+5        ;packed block size
  3567.     dw    8192        ;unpacked block size
  3568.     db    0        ;marker byte
  3569.     db    0        ;mark a run
  3570.     db    0        ;a 16 bit run count follows
  3571.     dw    8192        ;16 bit run count
  3572.     db    0        ;byte to fill run with
  3573. ;block 3 of fourth bit plane
  3574.     dw    5+5        ;packed block size
  3575.     dw    8192        ;unpacked block size
  3576.     db    0        ;marker byte
  3577.     db    0        ;mark a run
  3578.     db    0        ;a 16 bit run count follows
  3579.     dw    8192        ;16 bit run count
  3580.     db    0        ;byte to fill run with
  3581. ;block 4 of fourth bit plane
  3582.     dw    5+5        ;packed block size
  3583.     dw    3424        ;unpacked block size
  3584.     db    0        ;marker byte
  3585.     db    0        ;mark a run
  3586.     db    0        ;a 16 bit run count follows
  3587.     dw    3424        ;16 bit run count
  3588.     db    0        ;byte to fill run with
  3589.  
  3590.  
  3591.  
  3592. Example 3 - For more detail lets consider a block that isn't all the same.
  3593. Say the data consists of 30 2's, and 8, a 4, and 300 1's.
  3594.  
  3595. ; the block would look like this 
  3596.  
  3597.     dw    5+10        ;packed block size
  3598.     dw    332        ;30 + 1 + 1 + 300 bytes as above
  3599.     db    ff        ;what to mark a run with,
  3600.                                 ; because there are no ff's in our example.
  3601.  
  3602.     db    ff        ;mark a run 
  3603.     db    30        ;8 bit run count
  3604.     db    2        ;byte to fill run with - 2
  3605.  
  3606.     db    8        ;not a run marker, so must be data
  3607.  
  3608.     db    4        ;not a run marker, so must be data
  3609.  
  3610.     db    ff        ;mark a run
  3611.     db    0        ;means 16 bit run count follows
  3612.     dw    300        ;run count    
  3613.     db    1        ;byte to fill run with - 1
  3614.  
  3615.  
  3616. The actual unpacked data that resides in memory consists 2 seperate
  3617. sections.
  3618.  
  3619. 1. The control structure: contains x size, y size, x offset, y offset,
  3620.    segment of bit mapped data, number of bits per pixel and number of
  3621.    additional bit planes. this information is kept in pcpaint's data segment.
  3622.  
  3623. 2. The actual bit mapped data: contains the actual page image, mapped from
  3624.    bottom left (so bottom scan line is first). The data is contiguous within
  3625.    each bit plane, so scan line 1 follows scan line 0 directly. the page
  3626.    can and does cross segment boundires (a bit plane can be larger than
  3627.    64k). each bit plane follows the previous but starts on a paragraph
  3628.    boundary, the printer driver will be passed the offset in paragraphs
  3629.    between bit planes and the number of additional planes.
  3630.    The bit planes start with bit 0, each additional plane is the next bit.
  3631.  
  3632.  
  3633. ++---------------------------------------------------------------------
  3634.  
  3635.  
  3636.                      THE DATA TRANSFORMS FONT FORMAT
  3637.  
  3638.  
  3639.                          Data Transforms, Inc.
  3640.                            616 Washington St.
  3641.                          Denver, Colorado 80203
  3642.                             (303) 832-1501
  3643.  
  3644.  
  3645.                        Technical Support Contacts:
  3646.                             Bob Van Arsdale
  3647.                             Glenn Searfoss
  3648.                              Steven Boker
  3649.  
  3650. A Brief Background.
  3651.  
  3652.     Data Transforms' font library of over 200 different font styles
  3653.     (Fontpak Volumes 1 - 15, and Laser Fontpak volumes 1 & 2) was
  3654.     created by our IBM Fontrix graphics package.  The font creation
  3655.     limits of the Fontrix Font Editor are 1 x 1 to 96 x 96 pixels and
  3656.     may be any alphanumeric, language, or symbol.  Fontrix, written in
  3657.     C and Assembler, creates/saves images and fonts in a bit-mapped
  3658.     raster format.
  3659.  
  3660. The Fontrix Font Format Definition.
  3661.  
  3662.     "Font1 Structure Definition" describes the standard font header of
  3663.     a Data Transform non-compressed font.
  3664.  
  3665.     Each font has a header that defines the font and points to the
  3666.     character bitmaps.  Immediately following the font header is the
  3667.     character bitmap data.  Character bitmaps are stored as scanrects
  3668.     in scanline order from top to bottom.  Each scanline is stored
  3669.     bytewise left to right, left justified and rounded to byte length. 
  3670.     Each byte is stored 8 bits per byte where MSB is the leftmost
  3671.     pixel.
  3672.  
  3673.     "Font2 Structure Definition" details the header information for a
  3674.     font compressed using a "bounding box~ data compression method. 
  3675.     This method (see Figure 2) involves outlining a cell's "bit-on~
  3676.     character data with the smallest box possible.  Coordinates that
  3677.     position the "box~ relative to the original character cell are
  3678.     saved in the font header.  This compression method is automatic
  3679.     within the Data Transforms Font Editor when a font over 32 x 32
  3680.     pixels in size is saved.
  3681.  
  3682.     The bounding box routine can run at up to 90% of the over-all
  3683.     compression efficiency of more computationally expensive
  3684.     compression algorithms.  The actual character bits-on data is never
  3685.     compressed.  Information regarding the bounding box (size, [x,y]
  3686.     position within the original cell, etc...) is kept for each
  3687.     character in a lookup table in the font header.
  3688.  
  3689.     Using this compression method on the character cell in Figure 1
  3690.     (lower case "i~), the net gain in savings is 94% of the original
  3691.     character cell size.  For Figure 3 (upper case "W~), the net
  3692.     savings is 31% of the original character cell size.  The percentage
  3693.     in savings correlates to the discarded zero (bit off) data outside
  3694.     of the bounding box.
  3695.  
  3696.     The character data is never compressed; rather, the empty space
  3697.     outside of the bounding box is discarded.  The analogy of a
  3698.     shrink-wrap bag can be used to illustrate.
  3699.  
  3700.     Imagine a character cell placed within a shrink-to-fit bag.  The
  3701.     non-compressed cell is the unshrunk bag.  Now shrink the bag until
  3702.     all edges contact the outer limits of bit-on data, forming a
  3703.     rectangular bounding box.  For some characters, as in a lower case
  3704.     "i", this correlates to a major amount of shrinkage and the
  3705.     shrinkage correlates to saved data space, hence compression.  An
  3706.     upper case "W" may fill the majority of a cell.  In this instance
  3707.     minimal shrinkage will occur, with little or no saved data space. 
  3708.     However, the overall net savings in data space for an entire font
  3709.     set will be great since few characters fill an entire cell. 
  3710.  
  3711.  
  3712. /* FONT1 STRUCTURE DEFINITIONS */
  3713.  
  3714. struct font1head {          /* standard character font header */
  3715.     unsigned char fnttype;  /* font structure type: */
  3716.                             /* non-compressed type = 0x10 or compressed type = 0x14 */
  3717.     char fntname[13];       /* font name -always followed with a ".set" extension */
  3718.     unsigned char fntcheck; /* check digit - verifies a Data Transforms font */
  3719.                             /* non-compressed font = 0xba, compressed font = 0xdc */
  3720.     unsigned char fntbase;    /* baseline count (in pixels) from top to bottom, top = 0 */
  3721.     unsigned char fnttotal;    /* total characters in font:*/
  3722.                               /* limited to the lower 94 ASCII characters: 0x21 - 0x7E */
  3723.     unsigned char fntstart;    /* starting character */
  3724.     unsigned char fntstatus;/* proportional or non-proportional: 0 = non-proportional */
  3725.     unsigned char fnthsize;    /* horizontal cell size in pixels */
  3726.     unsigned char fntvsize;    /* vertical cell size in pixels */
  3727.     unsigned char fntbytes;    /* number of horizontal bytes in the current cell */
  3728.     unsigned char fntspaceh;    /* space bar horizontal size in pixels */
  3729.     unsigned char fntchargap;    /* pixels between characters default */
  3730.     unsigned char fntlfgap;    /* pixels between linefeeds default */
  3731.     int fntlength;    /* total length of file */
  3732.     unsigned char fntpitch;    /* italics pitch (0 = none) */
  3733.         /* bits 0 - 6 ... number of scanlines to skip */
  3734.         /* bit  7 ... 0 = decrement xpos, 1 = increment xpos */
  3735.     unsigned char fntinvert;    /* 0 = dont invert, 1 = invert */
  3736.     unsigned char fnthbold;    /* number of overlapping bits horizontal */
  3737.     unsigned char fntvbold;    /* number of overlapping bits vertical */
  3738.     unsigned char fnthmag;    /* integral horizontal bit magnification */
  3739.     unsigned char fntvmag;    /* integral vertical bit magnification */
  3740.     unsigned char fnthfract;    /* fractional horizontal bit magnification */
  3741.     unsigned char fntvfract;    /* fractional vertical bit magnification */
  3742.     unsigned char fntdirection;    /* Print direction 0 = left to right, 1...3 = counterclock 1...3 */
  3743.     unsigned char fntrot90;    /* rotation 0 = up, 1...3 = counterclock 1...3 */
  3744.     unsigned char fnthflip;    /* horizontal flip 0 = no, 1 = yes */
  3745.     unsigned char fntvflip;    /* vertical flip 0 = no, 1 = yes */
  3746.     unsigned char fntcolor;    /* color of font */
  3747.         /* bits 0 - 3 ... foreground color */
  3748.             /* bit 0 ... strike black ribbon */
  3749.             /* bit 1 ... strike blue ribbon */
  3750.             /* bit 2 ... strike red ribbon */
  3751.             /* bit 3 ... strike yellow ribbon */
  3752.         /* bits 4 - 7 ... background color */
  3753.             /* bit 4 ... strike black ribbon */
  3754.             /* bit 5 ... strike blue ribbon */
  3755.             /* bit 6 ... strike red ribbon */
  3756.             /* bit 7 ... strike yellow ribbon */
  3757.     unsigned char fntsubtype;    /* subcategory type of this font */
  3758.             /* 0 = normal font subtype */
  3759.             /* 1 = equation roman font subtype */
  3760.             /* 2 = equation symbol font subtype */
  3761.     unsigned char fntunused[18];    /* unused bytes */
  3762. };
  3763.  
  3764. struct font1 {    /* standard character font (type = 0x10) */
  3765.     struct font1head fhd;    /* font header */
  3766.     char *fntcellptr[FONT1TOTAL + 1];        /* offsets from beginning of file to character bitmaps */
  3767.     char fntcellwidth[FONT1TOTAL + 1];    /* cell widths if proportional */
  3768. };
  3769.  
  3770.  
  3771. /* FONT2 STRUCTURE DEFINITIONS */
  3772.  
  3773. struct font2 {
  3774.     struct font1head fhd2;            /* font header */
  3775.     unsigned int fnt2cellseg[FONT2TOTAL + 1];    /* array of segment pointers to characters */
  3776.     int fnt2cellhsize[FONT2TOTAL + 1];        /* array of cell horizontal sizes in bits */
  3777.     int fnt2cellhoffset[FONT2TOTAL + 1];    /* array of cell horizontal offsets in bits */
  3778.     int fnt2cellhbytes[FONT2TOTAL + 1];    /* array of cell horizontal size in bytes */
  3779.     int fnt2cellvsize[FONT2TOTAL + 1];        /* array of cell vertical sizes in bits */
  3780.     int fnt2cellvoffset[FONT2TOTAL + 1];    /* array of cell vertical offsets in bits */
  3781. };
  3782.  
  3783.     The data listed in the "struct font2~ portion of the (Font2) font
  3784.     structure above is defined as follows:
  3785.  
  3786.     * The font header is the same as described in the "struct
  3787.     font1head~ of the non-compressed font data format.
  3788.  
  3789.     * Font cell segments are an array of segment pointers to characters
  3790.     kept as offsets from the beginning of the font file.  For example,
  3791.     if an array value for a character = 10, then the starting address
  3792.     of a character's "bounding box~ data = (the start of file address +
  3793.     sizeof (struct font2)) + (10 x 16), where 1 segment = 16 bytes.
  3794.  
  3795.     * The Horizontal size is the actual width in bits of the bounding
  3796.     box.
  3797.  
  3798.     * The Horizontal offset is the distance in bits from the left edge
  3799.     of the cell to the upper lefthand corner of the bounding box.
  3800.  
  3801.     * Horizontal bytes refers to the actual size in bytes of the
  3802.     interior of the bounding box.
  3803.  
  3804.     * The Vertical size is the actual height in bits of the bounding
  3805.     box.
  3806.  
  3807.     * The Vertical offset is the distance in bits from the top edge of
  3808.     the cell to the upper edge of the bounding box.
  3809.  
  3810.  
  3811.  
  3812. ++---------------------------------------------------------------------
  3813.  
  3814.  
  3815. Technical Reference Manual
  3816.  
  3817. Including Information For:
  3818. Publisher's Paintbrush
  3819. PC Paintbrush Plus
  3820. PC Paintbrush
  3821.  
  3822. ZSoft Corporation
  3823. 450 Franklin Rd. Suite 100
  3824. Marietta, GA  30067
  3825. (404) 428-0008
  3826.  
  3827. IMAGE FILE (.PCX) FORMAT
  3828.  
  3829. The information in this section will be useful if you want to write a
  3830. program to read or write PCX files (images).  If you want to write a
  3831. special case program for one particular image format you should be able to
  3832. produce something that runs twice as fast as "Load from..."  in PC
  3833. Paintbrush.
  3834.  
  3835. Image files used by PC Paintbrush product family and FRIEZE (those with a
  3836. .PCX extension) begin with a 128 byte header.  Usually you can ignore this
  3837. header, since your images will all have the same resolution.  If you want
  3838. to process different resolutions or colors, you will need to interpret the
  3839. header correctly.  The remainder of the image file consists of encoded
  3840. graphic data.  The encoding method is a simple byte oriented run-length
  3841. technique.  We reserve the right to change this method to improve
  3842. efficiency.  When more than one color plane is stored in the file, each
  3843. line of the image is stored by color plane (generally ordered red, green,
  3844. blue, intensity), As shown below.
  3845.  
  3846. Scan line 0:     RRR...
  3847.         GGG...
  3848.         BBB...
  3849.         III...
  3850. Scan line 1:     RRR...
  3851.         GGG...
  3852.         BBB...
  3853.         III...
  3854. (etc.)
  3855. The encoding method is:
  3856. FOR  each  byte,  X,  read from the file
  3857.     IF the top two bits of X are  1's then
  3858.         count = 6 lowest bits of X
  3859.         data = next byte following X
  3860.     ELSE
  3861.         count = 1
  3862.         data = X
  3863.  
  3864. Since the overhead this technique requires is, on average, 25% of the
  3865. non-repeating data and is at least offset whenever bytes are repeated, the
  3866. file storage savings are usually considerable.
  3867.  
  3868. The format of the file header is shown below.
  3869.  
  3870. ZSoft .PCX FILE HEADER FORMAT
  3871.  
  3872. Byte    Item            Size    Description/Comments
  3873.  
  3874. 0    Manufacturer    1    Constant Flag  10 = ZSoft .PCX
  3875. 1    Version     1    Version information:
  3876.                 0 = Version 2.5
  3877.                 2 = Version 2.8 w/palette information
  3878.                 3 = Version 2.8 w/o palette information
  3879.                 5 = Version 3.0
  3880. 2    Encoding    1    1 = .PCX run length encoding
  3881. 3    Bits per pixel    1    Number of bits/pixel per plane
  3882. 4    Window      8    Picture Dimensions 
  3883.                 (Xmin, Ymin) - (Xmax - Ymax)
  3884.                 in pixels, inclusive
  3885. 12    HRes        2    Horizontal Resolution of creating device
  3886. 14    VRes        2    Vertical Resolution of creating device
  3887. 16    Colormap    48    Color palette setting, see text
  3888. 64    Reserved    1
  3889. 65    NPlanes            1    Number of color planes
  3890. 66    Bytes per Line    2    Number of bytes per scan line per 
  3891.                 color plane (always even for .PCX files)
  3892. 68    Palette Info    2    How to interpret palette - 1 = color/BW,
  3893.                 2 = grayscale
  3894. 70    Filler      58    blank to fill out 128 byte header
  3895.  
  3896. All variables of size 2 are integers.
  3897.  
  3898.  
  3899. Decoding .PCX Files First, find the pixel dimensions of the image by
  3900. calculating [XSIZE = Xmax - Xmin + 1] and [YSIZE = Ymax - Ymin + 1].
  3901.  
  3902. Then calculate how many bytes are required to hold one complete
  3903. uncompressed scan line:  TotalBytes = NPlanes * BytesPerLine
  3904. Note that since there are always an integral number of bytes, there will
  3905. probably be unused data at the end of each scan line.  TotalBytes shows
  3906. how much storage must be available to decode each scan line, including any
  3907. blank area on the right side of the image.
  3908.  
  3909. You can now begin decoding the first scan line - read the first byte of
  3910. data from the file.  If the top two bits are set, the remaining six bits
  3911. in the byte show how many times to duplicate the next byte in the file.
  3912. If the top bits are not set, the first byte is the data itself, with a
  3913. count of one.  Continue decoding the rest of the line.  Keep a running
  3914. subtotal of how many bytes are moved and duplicated into the output
  3915. buffer.  When the subtotal equals TotalBytes, the scan line is complete.
  3916.  
  3917. There will always be a decoding break at the end of each scan line.  But
  3918. there will not be a decoding break at the end of each plane within each
  3919. scan line.  When the scan line is completed, there may be extra blank data
  3920. at the end of each plane within the scan line.  Use the XSIZE and YSIZE
  3921. values to find where the valid image data is.  If the data is multi-plane
  3922. BytesPerLine shows where each plane ends within the scan line.  Continue
  3923. decoding the remainder of the scan lines.  There may be extra scan lines
  3924. at the bottom of the image, to round to 8 or 16 scan lines.
  3925.  
  3926. Palette Information Description
  3927.  
  3928. EGA/VGA 16 Color Palette Information
  3929.  
  3930. The palette information is stored in one of two different formats.  In
  3931. standard RGB format (IBM EGA, IBM VGA) the data is stored as 16 triples.
  3932. Each triple is a 3 byte quantity of Red, Green, Blue values.  The values
  3933. can range from 0-255 so some interpretation into the base card format is
  3934. necessary.  On an IBM EGA, for example, there are 4 possible levels of RGB
  3935. for each color.  Since 256/4 = 64, the following is a list of the settings
  3936. and levels:
  3937.  
  3938. Setting        Level
  3939. 0-63        0
  3940. 64-127        1
  3941. 128-192        2
  3942. 193-254        3
  3943.  
  3944. VGA 256 Color Palette Information
  3945.  
  3946. ZSoft has recently added the capability to store palettes containing more
  3947. than 16 colors in the .PCX image file.  The 256 color palette is formatted
  3948. and treated the same as the 16 color palette, except that it is
  3949. substantially longer.
  3950.  
  3951. The palette (number of colors x 3 bytes in length) is appended to the end
  3952. of the .PCX file, and is preceded by a 12 decimal.  To determine the VGA
  3953. BIOS palette you need only divide the values read in the palette by 4.
  3954.  
  3955. To access a 256 color palette:
  3956.  
  3957. First, check the version number in the header, if it contains a 5 there is
  3958. a palette.
  3959.  
  3960. Second, read to the end of the file and count back 769 bytes.  The value
  3961. you find should be a 12 decimal, showing the presence of a 256 color
  3962. palette.
  3963.  
  3964. CGA Color Palette Information
  3965.  
  3966. For a standard IBM CGA board, the palette settings are a bit more complex.
  3967. Only the first byte of the triple is used.  The first triple has a valid
  3968. first byte which represents the background color.  To find the background,
  3969. take the (unsigned) byte value and divide by 16.  This will give a result
  3970. between 0-15, hence the background color.  The second triple has a valid
  3971. first byte, which represents the foreground palette.  PC Paintbrush
  3972. supports 8 possible CGA palettes, so when the foreground setting isbetween
  3973. 0 and 255, there are 8 ranges of numbers and the divisor is 32.
  3974.  
  3975.  
  3976. CGA Color Map
  3977. Header Byte #16
  3978. Background color is determined in the upper four bits.
  3979. Header Byte #19
  3980.  
  3981. Only upper 3 bits are used, lower 5 bits are ignored.  The first three
  3982. bits that are used are ordered C, P, I.  These bits are interpreted as
  3983. follows:
  3984.  
  3985. c: color burst enable - 0 = color; 1 = monochrome
  3986. p: palette - 0 = yellow; 1 = white
  3987. i: intensity - 0 = dim; 1 = bright
  3988.  
  3989. PC Paintbrush Bitmap Character Format
  3990.  
  3991. The bitmap character fonts are stored in a particularly simple format.
  3992. The format of these characters is as follows:
  3993.  
  3994. Header (2 bytes)
  3995. font width    db    0a0h + character width (in dots)
  3996. font height    db    character height (in dots)
  3997. Character Widths (256 bytes)
  3998. char widths    db    256 dup(each char's width +1)
  3999. Character Images
  4000. (remainder of the file)
  4001.  
  4002. The characters are stored in ASCII order and as many as 256 may be
  4003. provided.  Each character is left justified in the character block, all
  4004. characters take up the same number of bytes.
  4005.  
  4006. Bytes are organized as N strings, where each string is one scan line of
  4007. the character.  See figure 2.
  4008.  
  4009. For example, each character in a 5x7 font requires 7 bytes.  A 9x14 font
  4010. uses 28 bytes per character (stored two bytes per scan line in 14 sets of
  4011. 2 byte packets).  Custom fonts may be any size up to the current maximum
  4012. of 10K bytes allowed for a font fil e.
  4013.  
  4014. Sample "C" Routines
  4015.  
  4016. The following is a simple set of C subroutines to read data from a .PCX
  4017. file.
  4018.  
  4019. /*
  4020.  * This procedure reads one encoded block from the image file and stores
  4021.  * a count and data byte.
  4022.  * Result:
  4023.  * 0 = valid data stored
  4024.  * EOF = out of data in file
  4025.  */
  4026.  
  4027. encget(pbyt, pcnt, fid)
  4028. int *pbyt;     /* where to place data */
  4029. int *pcnt;     /* where to place count */
  4030. FILE *fid;     /* image file handle */
  4031. {
  4032.     int i;
  4033.  
  4034.     *pcnt = 1;     /* safety play */
  4035.     if (EOF == (i = getc(fid)))
  4036.     return(EOF);
  4037.     if (0xc0 == (0xc0 & i)) {
  4038.     *pcnt = 0x3f&i;
  4039.     if (EOF == (i = getc(fid)))
  4040.         return(EOF);
  4041.     }
  4042.     *pbyt = i;
  4043.     return(0);
  4044. }
  4045.  
  4046. /*
  4047.  * Here's a program fragment using encget.  This reads an entire file and
  4048.  * stores it in a (large) buffer, pointed to by the variable "bufr".
  4049.  * "fp" is the file pointer for the image
  4050.  */
  4051.  
  4052.     while (EOF != encget(&chr, &cnt, fp))
  4053.     for (i = 0; i ~    *bufr++ = chr;
  4054.  
  4055.  
  4056. The following is a set of C subroutines to write data to a .PCX file.
  4057.  
  4058.  /* This subroutine encodes one scanline and writes it to a file */
  4059.  
  4060. encLine(inBuff, inLen, fp)
  4061. unsigned char *inBuff;  /* pointer to scanline data */
  4062. int inLen;            /* length of raw scanline in bytes */
  4063. FILE *fp;            /* file to be written to */
  4064. {  /* returns number of bytes written into outBuff, 0 if failed */
  4065.     unsigned char this, last;
  4066. int srcIndex, i;
  4067. register int total;
  4068. register unsigned char runCount; /* max single runlength is 63 */
  4069. total = 0;
  4070. last = *(inBuff);        runCount = 1;
  4071.  
  4072. for (srcIndex = 1; srcIndex  inLen; srcIndex++) {
  4073.     this = *(++inBuff);
  4074.     if (this == last)    {
  4075.          runCount++;    /* it encodes */
  4076.         if (runCount == 63)    {
  4077.             if (!(i=encput(last, runCount, fp)))
  4078.                 return(0);
  4079.             total += i;
  4080.             runCount = 0;
  4081.             }
  4082.         }
  4083.     else    {   /* this != last */
  4084.         if (runCount)    {
  4085.             if (!(i=encput(last, runCount, fp)))
  4086.                 return(0);
  4087.             total += i;
  4088.             }
  4089.         last = this;
  4090.         runCount = 1;
  4091.         }
  4092.     }    /* endloop */
  4093. if (runCount)    {        /* finish up */
  4094.     if (!(i=encput(last, runCount, fp)))
  4095.         return(0);
  4096.     return(total + i);
  4097.     }
  4098. return(total);
  4099. }
  4100.  
  4101. /* subroutine for writing an encoded byte pair 
  4102. (or single byte  if it doesn't encode) to a file */
  4103. encput(byt, cnt, fid) /* returns count of bytes written, 0 if err */
  4104. unsigned char byt, cnt;
  4105. FILE *fid;
  4106. {
  4107. if(cnt) {
  4108.     if( (cnt==1) && (0xc0 != (0xc0&byt)) )    {
  4109.         if(EOF == putc((int)byt, fid))
  4110.             return(0); /* disk write error (probably full) */
  4111.         return(1);
  4112.         }
  4113.     else        {
  4114.         if(EOF == putc((int)0xC0 | cnt, fid))
  4115.             return(0);     /* disk write error */
  4116.         if(EOF == putc((int)byt, fid))
  4117.             return(0);     /* disk write error */
  4118.         return(2);
  4119.         }
  4120.     }
  4121. return(0);
  4122. }
  4123.